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>