'Dynamically altering the slide content while presenting in google slides using apps scripting

I'm trying to create a polling app with google slides for a project. There are apps out there that do this already, e.g. Slido, Polleverywhere. They seem to insert an iframe over an existing webslide while the presentation is running.

I assumed that google's API would contain something that would allow you to monitor and change while in presentation mode. However, this does not seem to be the case. The problem is that within a google apps script there is no access to the top level window due to iframe sandboxing. How do these poll apps accomplish (a) dynamically altering the content of slides (b) monitoring whether the app is in presentation mode and which slide the user is on so the content can be modified.

I've been googling for days to try to find a hint. Any help welcome!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source