gpt4 book ai didi

javascript - 带有 chrome 扩展的 Google 表格 API,如何使用?

转载 作者:搜寻专家 更新时间:2023-10-31 23:18:42 26 4
gpt4 key购买 nike

我正在制作我的第一个 chrome 扩展。我的想法是调用 Google Sheets API 以在我的扩展程序中的 google 电子表格中附加一行。我指的是这个 link同样,并成功地尝试了 API 在我想要的工作表中追加行。

现在我正尝试从我的 chrome 扩展代码文件中执行相同的操作。您如何为您的扩展使用相同的示例代码,因为我们的扩展不允许内联 js。任何示例或基本样板都会有所帮助。

非常感谢。

最佳答案

您收到该错误是因为内联 JavaScript。
Chrome 扩展不允许任何内联脚本。 Read Here.

Inline JavaScript will not be executed
Inline JavaScript will not be executed. This restriction bans both inline blocks and inline event handlers (e.g. ).

所以任何 JavaScript 都必须来自它自己的 .js 文件。
通常在 popup.js 中使用 popup.html 和该页面的所有 JavaScript。
options.html 和 options.js 也是如此。


有用的链接:
Chrome Extension and Google Sheets
Tutorial for using OAuth

关于javascript - 带有 chrome 扩展的 Google 表格 API,如何使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48335559/

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