Unsafe attempt to initiate navigation for frame with origin 'https://docs.google.com' from frame with URL 'https://localhost:3000/taxonomytool-impl.html'. 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.

See original GitHub issue

Hi!

I am trying to add a link for users to give feedback on my gsheets web app. However I keep getting the error Unsafe attempt to initiate navigation for frame with origin 'https://docs.google.com' from frame with URL 'https://localhost:3000/taxonomytool-impl.html'. 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. whenever I click on the link.

I understand I just need to set the ‘allow-top-navigation-by-user-activation’ sandbox attribute on the iframe, but am struggling how to do so from this library since we never declare the iframe itsself anywhere. When I ctrl+f for iframe, I only see one tag and it looks like its in the dev index.js.

I suspect I can modify this code in the server ui.js file to add the attribute, but looks like I can’t call setAttribute here. Anyone have any ideas?

  const html = HtmlService.createHtmlOutputFromFile('taxonomytool')
    .setWidth(900)
    .setHeight(900);
  SpreadsheetApp.getUi().showModalDialog(html, 'Taxonomy Builder');
};

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
WillLiuMHcommented, Apr 28, 2021

Ahhh yeah I think I’m finding that too. Honestly though new tab is not a bad alternative. Thanks for your help here @enuchi and appreciate all the work you’ve put into this library!

0reactions
enuchicommented, Apr 28, 2021

I don’t think it’s going to work. I’m guessing Google really doesn’t want you to navigate to another page within its UI, for security reasons. Your best bet is to launch your page in a new tab with target _blank: <a href="http://www.yourpage.com" target="_blank">

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unsafe JavaScript attempt to initiate navigation for frame with ...
A document can navigate its decendant frames, or, more generally, a document can navigate a frame if the document is in the same...
Read more >
Unsafe JavaScript attempt to initiate navigation for frame with ...
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 ...
Read more >
Unsafe JavaScript attempt to initiate navigation for frame with ...
HTML : Unsafe JavaScript attempt to initiate navigation for frame with URL [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] ...
Read more >
Error when running embedded GAS Web App Google Site
I'm getting the following error when I hit the submit button: "Unsafe attempt to initiate navigation for frame with origin 'https://sites.google ...
Read more >
"Unsafe JavaScript attempt to initiate navigation for frame with ...
Hello! i'm finishing my twitch tv project but i still have one issue that i can't solve. When you click in any channel,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found