2016-10-28 186 views
0

我想創建一個Firefox擴展(我的第一個擴展,所以我是初學者)。 我想做這個例子:Firefox擴展與工具欄

enter image description here

但是,這是我的結果:

enter image description here

我不明白爲什麼我的圖片無法載入,爲什麼右邊框按鈕是空的,如果有可能增加工具欄的高度。

有我的代碼:

index.js:

var { ActionButton } = require('sdk/ui/button/action'); 
var { Toolbar } = require("sdk/ui/toolbar"); 
var { Frame } = require("sdk/ui/frame"); 

var previous = ActionButton({ 
    id: "previous", 
    label: "previous", 
    icon: { 
     "16": "./icons/previous.png" 
    }, 
    onClick: function(state) { 
     console.log("button '" + state.label + "' was clicked"); 
    } 
}); 

var next = ActionButton({ 
    id: "next", 
    label: "next", 
    icon: { 
     "16": "./icons/next.png" 
    }, 
    onClick: function(state) { 
     console.log("button '" + state.label + "' was clicked"); 
    } 
}); 

var play = ActionButton({ 
    id: "play", 
    label: "play", 
    icon: { 
     "16": "./icons/play.png" 
    }, 
    onClick: function(state) { 
     console.log("button '" + state.label + "' was clicked"); 
    } 
}); 

var frame = new Frame({ 
    url: "./frame-player.html" 
}); 

var toolbar = Toolbar({ 
    title: "Player", 
    items: [previous, play, next, frame] 
}); 

幀player.html:

<!DOCTYPE html> 
<html> 
    <head> 
    </head> 
    <body> 
    TEST 
    </body> 
</html> 

回答

0

通過將所有文件(圖片,腳本解決了,.. )在我的擴展的「數據」文件夾中。