如果 Firefox 插件中有如下代码片段:
var pagemod = PageMod({
include: ['*'],
contentScriptFile: [data.url('content.js')]
});
panel = require("sdk/panel").Panel({
width: 322,
height: 427,
contentURL: data.url("main.html"),
include:["http://*/*","https://*/*"],
contentScriptFile: [data.url('panel.js')]
});
我在 Chrome 扩展中找到了一些示例代码。它们用于window.parent.postMessage(message, "*")
发送消息并用于window.addEventListener("message",function (e) {//do something}
接收消息。如何直接在 Firefox 插件中将消息从“ panel.js
”发送到“ ”?content.js