3

I have created a Web App with different pages: login, dashboard, orders. I check if the user is logged in, if so will redirect to dashboard. Dashboard will have link to place order - takes to order page and once order is placed successfully it will redirect to dashboard.

Everything works fine when the app is used standalone, but after I embed in google sites, Hyperlink placed in the Dashboard page (To place orders) is not working with the error message

Unsafe JavaScript attempt to initiate navigation for frame with origin 'https://app.neelithal.com' from frame with URL 'https://n-n3gcqx22xvz3sn77god6de7c5ipcta6xrsyulmi-0lu-script.googleusercontent.com/userCodeAppPanel'. The frame attempting navigation of the top-level window is sandboxed, but the flag of 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' is not set.

I have tried embedding the appscript in both old and new sites with 'allow-top-navigation' or 'allow-top-navigation-by-user-activation' - still not working.

All the pages are set with base target _top Auto Redirect is done via window.self.location.href = redirectUrl; -- NOTE - If I use window.top.location embeded site will not work - Works only if I use window.self.location.href.

For the Hyperlink I am using the below code

<a class="waves-effect" href="<?!= appUrl ?>?v=dashboard&token=<?!= token ?>">

-- NOTE I have tried hyperlink target as "_top" "_self" "framename" nothing works - One or the other is broken.

XFrameoption set to ALLOWALL

    var tmp = HtmlService.createTemplateFromFile("glogin");
    return tmp.evaluate().setXFrameOptionsMode(HtmlService.XFrameOptionsMode.ALLOWALL);

Script is executed as ME - Access to everyone even Ananymous - Using Google Login for authentication.

Webapp URL - https://script.google.com/macros/s/AKfycbzyx5XDtVYPSN5wt_By55pZGpHMSgTnMN_wQd9uIYuG9N9mPME2/exec

Google Sites Url - with custom url - https://app.neelithal.com

Marios
  • 26,333
  • 8
  • 32
  • 52

0 Answers0