admin管理员组

文章数量:1312844

I have issue on Google Chrome with a Web app developed on Google app script and published as Web app. The Web app is being embedded to Wix site as an iframe. It works well on desktop browsers, but it doesn't work on mobile specifically in Google Chrome.

Google Chrome changes its URL structure and adding additional parameters in the URL like if the URL is

/{script_id}/exec

But on mobile it changes to: /{script_id}/exec

Additional /u/4/ in the url.

Which makes the app script url as 404 not found.

Any solution to avoid from this url change?

Another Web app on same site exactly similarly is already working without url change.
So not sure how to avoid this situation.

I tried it on mobile safari it works.
Tried on Google chrome without a user logged in with Google and it worked.
Chrome mobile incognito mode already working.

But when we try with login with Google or Google account logged in it doesn't work specifically when multiple Google accounts logged in to device or Chrome.

I have issue on Google Chrome with a Web app developed on Google app script and published as Web app. The Web app is being embedded to Wix site as an iframe. It works well on desktop browsers, but it doesn't work on mobile specifically in Google Chrome.

Google Chrome changes its URL structure and adding additional parameters in the URL like if the URL is

https://scripts.google/macros/s/{script_id}/exec

But on mobile it changes to: https://scripts.google/macros/u/4/s/{script_id}/exec

Additional /u/4/ in the url.

Which makes the app script url as 404 not found.

Any solution to avoid from this url change?

Another Web app on same site exactly similarly is already working without url change.
So not sure how to avoid this situation.

I tried it on mobile safari it works.
Tried on Google chrome without a user logged in with Google and it worked.
Chrome mobile incognito mode already working.

But when we try with login with Google or Google account logged in it doesn't work specifically when multiple Google accounts logged in to device or Chrome.

Share Improve this question edited Jan 31 at 18:13 Wicket 38.4k9 gold badges78 silver badges193 bronze badges asked Jan 31 at 14:43 faisal manzoorfaisal manzoor 133 bronze badges 6
  • Please provide a minimal reproducible example. – leylou Commented Jan 31 at 15:00
  • It's known that the HTML Service from Google Apps Script, used in dialogs, sidebars and web applications, doesn't support the Google Accounts multiple sign-in feature. One workaround is to allow anyone to access the web application. Depending on what the web app does and how it does that, it might require redesigning it. – Wicket Commented Jan 31 at 18:19
  • I have never run into this before but I'd try to split on forwaard slash and remove the a and the 4 and reassemble the url and see if it works. – Cooper Commented Feb 1 at 3:31
  • @Wicket is this really a multiple sign in issue? – Cooper Commented Feb 1 at 3:33
  • @Cooper Based on the details given by the OP, yes – Wicket Commented Feb 1 at 14:36
 |  Show 1 more comment

1 Answer 1

Reset to default 0

I noticed the other Google App Script Web App that was working had a url structure different than this one with issues...

Problematic Web App URL: https://scripts.google/macros/s/{script_id}/exec

I tried to publish another app, initially with "Google Account logged in" can access the web app (not Anyone can access). When I published with this permission, the generated deployment URL was in different structure, like this (https://scripts.google/a/macros/{script_id}/exec), then I changed the permission to "Anyone" can access... and I tried to execute embed the web app with this new URL structure and it worked.

So What I understood, if anyone face this issue, must use different url structure to get the url with /a/macros/... instead of /macros/s/

So this URL: https://scripts.google/macros/s/{script_id}/exec (will cause issues if multiple goolge accounts logged in on mobile chrome browser...

and this URL: https://scripts.google/a/macros/{script_id}/exec should be working without URL changes.

For me it worked and saved my many hours of work on migrating web app to alternative platforms.

本文标签: javascriptWeb app URL changing automatically on mobileStack Overflow