Google独立应用程序

发布于 2025-02-07 18:53:08 字数 692 浏览 1 评论 0原文

我为Google Web应用程序写了一个独立的Google应用程序脚本。在单击“提交”按钮的单击时,我会收到以下错误。

USERCODEAPPPANEL:23不安全的尝试从url frame启动使用“ https://script.google.com”启动框架导航。逐个用户激活'标志,但没有用户激活

我试图添加动态锚标签,然后在同一时添加单击事件。仍然不起作用。

我已经使用链接创建了一个动态锚标签,并激活了点击事件。

 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(); 

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(); 

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文