如何使用firefox附加组件SDK添加工具栏?
我尝试通过添加小部件并将面板附加到其上来实现相同的效果,但它也不支持浮动面板,并且面板也显示在scree上方(隐藏了scree内容)。 我想显示一个包含一些内容的工具栏。
答案 0 :(得分:1)
示例:
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: "./icons/previous.png"
});
var next = ActionButton({
id: "next",
label: "next",
icon: "./icons/next.png"
});
var play = ActionButton({
id: "play",
label: "play",
icon: "./icons/play.png"
});
var frame = new Frame({
url: "./frame-player.html"
});
var toolbar = Toolbar({
title: "Player",
items: [previous, next, play, frame]
});