gpt4 book ai didi

google-apps-script - Google Script 应用程序在隐身模式下失败

转载 作者:行者123 更新时间:2023-12-04 15:23:43 29 4
gpt4 key购买 nike

我有一个简单的 Google Script 发布为具有匿名访问权限的网络应用程序。代码可用 here网络应用程序可用 here .

code.gs

function doGet() {
return HtmlService.createHtmlOutputFromFile("index").setTitle("Google Script")
}

index.html

<!DOCTYPE html>
<html>
<head>
<base target="_top">
</head>
<body>
<p>Hello</p>
</body>
</html>

脚本网络应用程序在正常的 Chrome 模式下运行,但在 Chrome 或 Firefox 的隐身模式下查看页面时返回 500 错误。

脚本在 V8 和 DEPRECATED_ES5 运行时均失败并出现 500 错误。

查看截图。

enter image description here

最佳答案

是的,它在新项目中始终可重现。

我有同样的问题......它与HtmlService有关

应用脚本运行了大约一年,但昨天开始返回错误“Google Docs 遇到错误”。

return HtmlService.createHtmlOutput("<p>Hello World</p>");

如果我登录它就可以工作,但是当人们访问我的网站时,该脚本旨在将动态列表作为 html 返回,因此它需要以“像任何人一样,甚至是匿名的方式”运行。

部分解决方法:

我的一些脚本是仅返回字符串的 API,解决方法是使用 ContentService 而不是 HtmlService

return ContentService.createTextOutput("Hello World");

关于google-apps-script - Google Script 应用程序在隐身模式下失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62770318/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com