2016-01-27 53 views
0

我正在研究Firefox擴展,並且收到此錯誤消息。這是什麼意思?JPM [error]消息:SyntaxError:重複標籤

唯一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

A page-workercontentScript是源代碼。應改爲contentScriptFile

require("sdk/page-worker").Page({ 
    contentScriptFile: [ ... some scripts ... ] 
});