0
我想創建一個Firefox擴展(我的第一個擴展,所以我是初學者)。 我想做這個例子:Firefox擴展與工具欄
但是,這是我的結果:
我不明白爲什麼我的圖片無法載入,爲什麼右邊框按鈕是空的,如果有可能增加工具欄的高度。
有我的代碼:
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>