Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想打开一个标签,main.js所以我做了:
main.js
tabs.open(data.url("page.html"));
但是我如何让打开访问require功能的页面?我有一个存储在简单存储中的值,我需要将其写入页面。我读了一些关于使用可以访问页面的内容脚本的内容,但这似乎只适用于面板。
require
我认为您需要查看内容脚本文档,特别是“与内容脚本通信”:
https://addons.mozilla.org/en-US/developers/docs/sdk/1.0/dev-guide/addon-development/web-content.html
这有点复杂,本质上 Addons SDK 实现了一种在您的 Addons 代码和在 html 页面中运行的脚本之间发送消息的方法。