我正在使用firefox扩展程序并收到此错误消息。这是什么意思?
我唯一的label
来自:
require("sdk/ui/button/action").ActionButton({
id: "show-popup",
label: "something that can't possibly be a duplicate",
...
稍后我会添加一个背景页面:
require("sdk/page-worker").Page({
contentScript: [ ... some scripts ... ]
});
测试时,我收到错误:
> jpm run -b $(which firefox)
JPM [info] Starting jpm run on MyExtensionTitle
JPM [info] Creating a new profile
console.error: myextensiontitle:
JPM [error] Message: SyntaxError: duplicate label
仅当我添加后台脚本时才会发生这种情况。我该如何进一步调试?我所要做的就是一个含糊不清的终端消息,没有行号。
答案 0 :(得分:0)
page-worker' s contentScript
是源代码。它应该是contentScriptFile
而不是:
require("sdk/page-worker").Page({
contentScriptFile: [ ... some scripts ... ]
});