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 issueHi!
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:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Related StackOverflow Question
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!
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">