为什么Microsoft Edge显示“状态:失败”当Chrome每次工作时,在Google Apps脚本中使用客户端服务器函数集成时?

发布于 2025-02-11 03:59:14 字数 1517 浏览 3 评论 0原文

我的代码

我有一个测试范围,并且我有一个链接到它的应用程序脚本项目。

代码。GS的

function onOpen() 
{
   var testMenu = SpreadsheetApp.getUi() 
      .createMenu('Custom Menu');

      testMenu.addItem('Show UI in sidebar', 'showSidebar');
      testMenu.addToUi();
};

function showSidebar(){
  var html = HtmlService.createTemplateFromFile('Page');
  SpreadsheetApp.getUi().showSidebar(html.evaluate());
}

function doWorkInAppsScriptFile()
{
    Logger.log("WORKING")
}

代码

<h2>google script run test</h2>
<div style="width:98%;margin:10px">
    <div style="width:98%;margin:10px;padding:10px;text-align:center">
        <input type="button"  id="saveButton" onclick="onSave()" value="Save" style="background:DarkGreen;color:White;font-weight:bold;margin:10px"/>
    </div>
</div>

<script type="text/javascript">

function onSave(){          
  google.script.run.doWorkInAppsScriptFile();     

}

</script>

这是Microsoft Edge中的 不足以发表图像)

Microsoft Edge失败(在Google Chrome运行时 ,它显示出“从Google Chrome出现”。完全的”:

Google

  • 完成
  • ​(64位)版本103.0.1264.37(官方构建)(64位)
  • Chrome版本:版本102.0.5005.115(官方构建)(64位)

My code

I have a test spread sheet and I have an Apps Script project linked to it.

Here is the code for Code.gs

function onOpen() 
{
   var testMenu = SpreadsheetApp.getUi() 
      .createMenu('Custom Menu');

      testMenu.addItem('Show UI in sidebar', 'showSidebar');
      testMenu.addToUi();
};

function showSidebar(){
  var html = HtmlService.createTemplateFromFile('Page');
  SpreadsheetApp.getUi().showSidebar(html.evaluate());
}

function doWorkInAppsScriptFile()
{
    Logger.log("WORKING")
}

And the code for Page.html

<h2>google script run test</h2>
<div style="width:98%;margin:10px">
    <div style="width:98%;margin:10px;padding:10px;text-align:center">
        <input type="button"  id="saveButton" onclick="onSave()" value="Save" style="background:DarkGreen;color:White;font-weight:bold;margin:10px"/>
    </div>
</div>

<script type="text/javascript">

function onSave(){          
  google.script.run.doWorkInAppsScriptFile();     

}

</script>

Problem

In Microsoft edge: the Apps Script logger shows "Status: Failed"
Microsoft edge failure (Not enough rep to post image)

While when running from google chrome it shows "Completed":
Google completion

Other info:

  • OS: Arch Linux
  • Edge Version: Version 103.0.1264.37 (Official build) (64-bit)Version 103.0.1264.37 (Official build) (64-bit)
  • Chrome version: Version 102.0.5005.115 (Official Build) (64-bit)

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

爱冒险 2025-02-18 03:59:14

我发现了。如果我登录所有帐户,则可以使用。

I figured it out. If I sign out of all accounts, it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文