I have written a standalone google app script for a google web app. when I open a new window on the click of the submit button i get the following error.
userCodeAppPanel:23 Unsafe attempt to initiate navigation for frame with origin 'https://script.google.com' from frame with URL.The frame attempting navigation of the top-level window is sandboxed with the 'allow-top-navigation-by-user-activation' flag, but has no user activation.
I have tried to add a dynamic anchor tag and then add a click event on the same . still it does not work.
I have created a dynamic anchor tag with the link and activated the click event .
var templink= url+"?role="+role+"&sheetname="+sheets+"&page=Link2"; //
var temp="window.open("+"'"+templink+"'"+",'popup','width=1000,height=1000','_top')";
var link = document.createElement('a');
link.id = 'linkURL';
link.setAttribute('target', '_top'); document.body.appendChild(link); link.setAttribute('onclick',temp); document.getElementById("linkURL").click();