我正在设计一个火狐扩展名, 我想在地址栏附近添加一个按钮。 然后我要在那个按钮上附加一个书签 。
有人能告诉我,我需要使用什么API 来创建那个按钮和添加书签吗?
我正在设计一个火狐扩展名, 我想在地址栏附近添加一个按钮。 然后我要在那个按钮上附加一个书签 。
有人能告诉我,我需要使用什么API 来创建那个按钮和添加书签吗?
在此举一个例子, 使用 Erik Vold s 工具栏按钮库在地址栏附近添加按钮 :
const data = require("self").data;
const tabs = require("tabs");
exports.main = function(options) {
var btn = require("toolbarbutton").ToolbarButton({
id: my-toolbar-button ,
label: Add skull! ,
image: data.url( skull-16.png ),
onCommand: function() {
if (typeof(tabs.activeTab._worker) == undefined ) {
let worker = tabs.activeTab.attach({
contentScript: self.port.on("sayhello", function() { alert("Hello world!"); })
});
tabs.activeTab._worker = worker;
}
tabs.activeTab._worker.port.emit("sayhello");
}
});
if (options.loadReason === "install") {
btn.moveTo({
toolbarID: "nav-bar",
forceMove: false // only move from palette
});
}
};
您也可以在“ 添加上构建器” 站点上将此视为可运行的示例 :
I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....
I wanna move a div block to the top, so I coded like this: CSS part: .movingPart{ margin-top:80px; } jQuery part: $(document).ready(function() { $( #btn ).click(function() { $( .movingPart )....
I m currently using a Cache Manifest (as described here). This effectively makes the necessary resources to run the application available when the user is offline. Unfortunately, it works a little ...
I m looking at getting a FireFox plugin developed - but is it possible to create a plugin that is for private use only, so only those I share it with have it and not open to the masses? Need this for ...
I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...
I have a timer in my JavaScript which needs to emulate clicking a link to go to another page once the time elapses. To do this I m using jQuery s click() function. I have used $().trigger() and window....
I m developing a web application for a new service, starting from Firefox 3.5. The interface design is tableless, only using divs + CSS & performance-blessed practices. Now, while being ...
Does anybody know a proper, cross-browser way to "empty" an IFrame? Is "about:blank" recognized without error across all browsers? Is it valid to give an IFrame an empty src?