Serve HTML as a Google Docs, Sheets, Slides, or Forms user interface doesn't work - google-apps-script

I'm trying the example presented by Google for adding a menu item that displays a dialog in a Google spreadsheet found here: https://developers.google.com/apps-script/guides/html/ Upon selecting 'Open' from the added menu, the dialog comes up but only displays the title. The 'Hello World' and button do not display. Is their code outdated or ???
Here's a link to a spreadsheet with the example code. Doesn't work for me. Dialog comes up with only the title. https://docs.google.com/spreadsheets/d/1hYMQIlvV39iXHXYkkHanu4bL5p9F0aF7Up-F7oRoHLE/edit?usp=sharing

Thank you Cooper. It turns out it was a browser extension causing the issue.

Related

Use Google App Script to prevent user opening url link in Sheets if site is already open in another browser tab

I've got a Google Sheet that contains numerous hyperlinks.
I'd like to prevent the user from opening multiple instances of the same site.
ie. user clicks the hyperlink in one cell which opens the linked site in a new tab, then attempts to click the same hyperlink while the first new tab is still open - I'd like a dialogue box to appear saying that they cannot open this second new tab until they have closed the first one.
Is this possible via Google App Script?
Many thanks!
Unfortunately not. GAS has no access to your browser data and cannot know what tabs are open.Moreover, GAS has no way of intercepting hyperlink clicks from within a spreadsheet, it can only do that in a side bar, modal (or modeless) dialog, a custom or an add-on menu or an image with a script attached to it.

Display a editable Google Sheet on a web page

I want to display an editable Google Sheet on a web page.
No problem for that.
The problem: I want to display this sheet without the menus, columns and lines. Is it possible ?
Or display the sheet in full screen mode, but I do not know the javascript function to execute when opening the sheet.
Ex.: https://docs.google.com/spreadsheets/d/1xwheykkZMb806JKNoPGcVl17TpIm4Z9LTLJb8HAhVVk/edit?usp=sharing
How to do ?
Thank you
Go to File > Publish to the Web.
And then, you will see this kind of pop up. You can publish it and also get the link. Google Slide and Docs also have this feature. As you can see it, you can also get embed tag for inserting it in HTML. You can stop publishing with the Stop publishing button whenever you want.
And as far as I know, there is no such thing that you can edit the file with that mode.

Google Chrome extension - integrate with Google Calendar

How can a Chrome extension alter the Google Calendar event editing UI?
I see that, for example, the Moxtra extension has managed to inject UI including a button just below the location. According to their YouTube video they added a button to fill out the event description although when I installed Moxtra this no longer seems to work.
Stepping back from this a bit, it occurs to me that editing the Google Calendar page seems like something that could easily get messed up by future changes to Google Calendar. Perhaps it is better to edit the event description from the extension's own UI? If so, how can that be done?
Thanks.
It can be done with content scripts and modification of the DOM.
They probably check Event edit page for specific selectors and try to insert their own elements in the page, if they found it.
So, if UI of Google Calendar will change, extensions like Moxtra will be probably also broken.
You are right about the edit of the description - it's safer. But you still need to get a description field and change a content of it. There is no 100% safe way to do it and don't break on the change of UI.

How to show images on text hover in google docs addon

I am new to google docs Add-ons. I am working on an add-on in which I need to show set of image on text hover like tooltip in html
I did not find a way to implement this after hours of googling. please help.
This is not possible.
The above because the Documents Service of Google Apps Script doesn't include "on hover" event / trigger or something similar
The only way is by using a dialog or sidebar and they can only be launched by clicking on a custom menu or by using google.script.run on a previously opened dialog / sidebar.
References
https://developers.google.com/apps-script/guides/doc
https://developers.google.com/apps-script/guides/triggers
https://developers.google.com/apps-script/guides/dialogs
Related
Show Popup of YouTube video within Google Doc

How to create a secondary slide-out in Google Doc add on side bar in Google Apps Script

I have a Google Doc add-on that utilizes the sidebar: no problem there. When one uses the Google research add-on, there is an secondary slide out from the sidebar that shows a preview of a search result (see picture below) when clicked. I am hoping to replicate this behaviour, but I see nothing about it in the api regarding size and limits. I tried having a tooltip pop up on my links in the sidebar, but they appear cut off or under the main Google Doc palette. I have tried a bunch of other Google Doc add-ons to see if any of them replicate this functionality, but they don't. Before I spend hours on this, I want to first ask is anyone know if this is specific permission for Google's sidebar only, or can developers replicate this functionality?
The Research Tool is a direct integration with Docs and Presentations, it's not a Google Apps Script add-on. The freedom to "slide out" within the document is not available to add-ons today.
As one alternative, you could use an accordion affect to collapse your "first page" and overlay the result page, still within the bounds of the sidebar.
A second alternative would be to use a non-modal window, where you'd have more freedom. (resizing there requires client-server exchanges, but is doable)