firefox-addon-sdk

How to make a redirect in Firefox page-mod?

牧云@^-^@ 提交于 2019-12-21 17:56:35
问题 I'm trying to port my Google Chrome extension to Firefox Add-On SDK and I need the extension to filter pages from my website and make redirects. For example, if the user opens " http://example.com/special " I need to send him to " http://example.com/redirect " in the same browser tab. This is how I tried to do this: var pageMod = require("page-mod").PageMod({ include: "*", contentScriptWhen: "start", contentScript: "", onAttach: function(worker) { if (worker.tab.url == worker.url && worker

How to make a redirect in Firefox page-mod?

萝らか妹 提交于 2019-12-21 17:56:29
问题 I'm trying to port my Google Chrome extension to Firefox Add-On SDK and I need the extension to filter pages from my website and make redirects. For example, if the user opens " http://example.com/special " I need to send him to " http://example.com/redirect " in the same browser tab. This is how I tried to do this: var pageMod = require("page-mod").PageMod({ include: "*", contentScriptWhen: "start", contentScript: "", onAttach: function(worker) { if (worker.tab.url == worker.url && worker

accessing history in a firefox addon

。_饼干妹妹 提交于 2019-12-21 02:41:49
问题 I'm working on a firefox addon, using the addon builder. I want to periodically scan the browser's history.. the entire history. I'm looking for functionality like chrome's history api. It seems window.history is limited to session history only. Any help? I'm going crazy trying to figure this out. Addons like history export must do something like this, but their code is not immediately understandable to me. 回答1: You'll need to access the xpcom service nsIBrowserHistory, here's some example

Create mozilla extension to display a popup and iframe in it

安稳与你 提交于 2019-12-21 02:35:25
问题 Am trying to develop a mozilla extension. I just need to display an iframe in a popup, but don't know how to do this. My requirement is Add a extension button on top Navigation Tool bar Display an iframe on a popup while clicking on the extension button. I didn't find any tutorial similar to this. Please help me. Thank you... Hariprasad 回答1: In a xul based extension you can do it like this: In your xul file: <toolbarpalette id="BrowserToolbarPalette"> <toolbarbutton id="mainToolbarIcon" image

Find URL of current tab. Making a FireFox Browser add-on

天大地大妈咪最大 提交于 2019-12-20 18:10:58
问题 I'm making a Firefox Browser Add-on and need to find the url of the current tab I've tried this post Opening a URL in current tab/window from a Firefox Extension but it tells me that 'window' is not defined. (I think because I am making an add-on rather than an extension.) Here's what I've tried to do: var widgets = require('widget'); var tabs = require('tabs'); var widget1 = widgets.Widget({ id: "widget1", label: "widget1", contentURL: "http://www.mozilla.org/favicon", onClick: function() {

how to use post in “Request” function at firefox-addon-sdk

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-20 14:27:15
问题 I read about function 'Request' as this link: https://addons.mozilla.org/en-US/developers/docs/sdk/1.1/packages/addon-kit/docs/request.html And I would like to use the "post" method. There is no explaination or example on how to send a variable from JS to my server with the post method. How can I do it? 回答1: You just change the get() call in the example on that page with post(). exports.main = function() { var Request = require("request").Request; Request({ url: "http://google.com/", content:

how to use post in “Request” function at firefox-addon-sdk

你说的曾经没有我的故事 提交于 2019-12-20 14:24:36
问题 I read about function 'Request' as this link: https://addons.mozilla.org/en-US/developers/docs/sdk/1.1/packages/addon-kit/docs/request.html And I would like to use the "post" method. There is no explaination or example on how to send a variable from JS to my server with the post method. How can I do it? 回答1: You just change the get() call in the example on that page with post(). exports.main = function() { var Request = require("request").Request; Request({ url: "http://google.com/", content:

Select A File Within Firefox Add-On Directory

别说谁变了你拦得住时间么 提交于 2019-12-20 06:38:52
问题 I'm converting an XUL-based Firefox add-on to an SDK based version for simplicity. The XPCOM modules I use in the XUL-based version seem to work but ci.nsIFile is behaving differently. I can't figure out how to navigate to smartProxy.py which currently sits on the highest level of the directory. In the XUL version smartProxy.py sits on chrome/bin/smartproxy.py. I use the commands below to execute the program and it works without error. getExeFile: function() { var file = cc["@mozilla.org/file

Integrating an add-on into a custom Firefox build

馋奶兔 提交于 2019-12-20 05:14:32
问题 I'm making a custom Firefox build. I would like to integrate my add-on (Add-on SDK) into the build. I would prefer this rather than directly integrating with the Firefox code. What is the best way to achieve this? I'm thinking about placing it into the /browser/extensions/ directory. If this is a good idea, then please explain to me why (or point to appropriate docs files). There is a very similar question about this: How to integrate add-ons (.xpi) into my custom Firefox build? Unfortunately

Integrating an add-on into a custom Firefox build

依然范特西╮ 提交于 2019-12-20 05:13:11
问题 I'm making a custom Firefox build. I would like to integrate my add-on (Add-on SDK) into the build. I would prefer this rather than directly integrating with the Firefox code. What is the best way to achieve this? I'm thinking about placing it into the /browser/extensions/ directory. If this is a good idea, then please explain to me why (or point to appropriate docs files). There is a very similar question about this: How to integrate add-ons (.xpi) into my custom Firefox build? Unfortunately