ScriptApp.getService().getUrl() behaving differently Rhino / V8

579 views
Skip to first unread message

Pablo Felip

unread,
Feb 17, 2020, 8:13:30 PM2/17/20
to Google Apps Script Community
Hi, all,

I've just noticed this odd behaviour of ScriptApp.getService().getUrl()... under Rhino, you get the usual public URL of a published webapp:

ERBItg7UUAAw_Xk.png



But after changing the execution engine to V8 (same script, just some seconds later, no tinkering with deployments), I get this:



ERBItgYWkAAO7p4.jpeg


The second URL (V8), ending with /dev, is the private one useful while testing. I've tried with several different scripts and this behaviour seems consistent, at least on my side.  Instructing the user of a document-bound AppsScript template to get into code editor > deploy to get the public URL is not that bad, but simple things like showing it programatically help reduce friction, IMO.


Any idea why this is happening? Bug or by design (for reasons beyond my understanding)? Any workaround for this? (using the Apps Script API to manage deployments is not an option).

Alan Wells

unread,
Feb 17, 2020, 8:17:58 PM2/17/20
to Google Apps Script Community

Tanaike

unread,
Feb 17, 2020, 9:53:43 PM2/17/20
to google-apps-sc...@googlegroups.com
Is this thread useful for your situation? https://stackoverflow.com/a/60236195

Pablo Felip

unread,
Feb 18, 2020, 9:48:08 AM2/18/20
to google-apps-sc...@googlegroups.com
Thanks, I saw that... the issue is not exactly the same, although it seems to be closely related. I suppose that V8 has a certain amount of quirks yet to be ironed out. For the time being, I will revert to Rhino on the affected script(s).

Pablo Felip

unread,
Feb 18, 2020, 10:22:47 AM2/18/20
to google-apps-sc...@googlegroups.com
Thanks, Tanaike. I noticed this behaviour while working on a small project that will be distributed as a document bound script (Google Slides template). I wanted to make it as easy to reuse as possible, so instructing the user to bind his copy(ies) of the script to a standard GCP project and activate the Apps Script API maybe isn't the best choice. Probably getting into the editor and publishing as a webapp is a more straightforward solution until we eventually get an advanced service to properly manage deployments.

Tanaike

unread,
Feb 18, 2020, 7:41:06 PM2/18/20
to Google Apps Script Community
Thank you for replying. I think so. And also, I hope for being added Apps Script API to Advanced Google services.

Reply all
Reply to author
Forward
0 new messages