I’m wondering if there’s a way to use Google Apps Script to automatically display a fullscreen iframe containing an external website when someone opens a Google Doc.
Here’s what I want to happen:
User opens a particular Google document
Apps Script triggers automatically
A fullscreen iframe loads on top of the document showing a different website
The embedded site should work normally with mouse controls, audio, keyboard input, etc
I’ve been experimenting with this but haven’t been able to get it working properly. Are there any methods or workarounds that could make this possible? Any suggestions would be really helpful!
Nah, this won’t work with Google Docs. I tried something similar last month and Google blocks most iframe stuff. You might want to try Google Sites instead - it’s much easier to embed external content there rather than forcing Docs to do something it wasn’t built for.
Unfortunately, you can’t do this in Google Docs. Google blocks iframe embedding and fullscreen functionality for security reasons. I encountered similar issues when working on a project for a client last year. The document container restricts the necessary DOM manipulation for fullscreen overlays. A more effective approach might be to create a standalone web app that mimics a document but serves your iframe content instead. This would give you comprehensive control over the experience, albeit outside of Google’s ecosystem.
Google Docs won’t allow fullscreen iframes through Apps Script due to strict security protocols and limited DOM access. I’ve faced this issue as well. A viable workaround is to create a custom sidebar using HtmlService to display external content, although it won’t be in fullscreen. Alternatively, you can establish an onOpen trigger that redirects users to a standalone web app, which provides complete iframe control and the fullscreen experience, albeit outside the document itself.
totally feel ya on that! apps script has its limits. google really locks down iframes in docs for safety reasons, which is a bummer. maybe try building a web app that opens in a new tab? it’s a bit of a hassle but might work better!
Yeah, Google Docs iframe restrictions are such a pain. Hit this same wall building dynamic document experiences.
You need to intercept that document open event and redirect to something you control. Manual redirects and web apps work but they’re clunky as hell.
I solved this with automation. Built a system that monitors document access and automatically serves the iframe through a proper web interface. No more fighting Google’s security restrictions.
Key is having your automation handle trigger detection and redirect seamlessly. User clicks doc link, gets routed to your fullscreen iframe instead. Way cleaner than manual workarounds.
Latenode makes this workflow automation dead simple. Set up document monitoring, user routing, and iframe delivery in one flow. Check it out: https://latenode.com