firefox-addon

Triggering a custom event with attributes from a Firefox extension

让人想犯罪 __ 提交于 2020-05-11 07:38:18
问题 I have a Firefox extension that modifies the content of the page that the user is looking at. As part of that process the extension needs to trigger a custom event that the extension itself adds to the page source. I am having difficulties passing parameters to that custom event. What am I doing wrong? Script block inserted into the head of the page: document.addEventListener("show-my-overlay", EX_ShowOverlay, false, false, true); function EX_ShowOverlay(e) { alert('Parameter: ' + e.index); /

Twitter Request Token Wahts Wrong with this HTTP?

亡梦爱人 提交于 2020-05-01 08:53:49
问题 I'm sure I'm doing things, my oauth key is right, nonce, etc,however I'm geting 401 unauthorized. I'm trying to request a token from twitter api request_token. /***********REQUEST HEADERS*********/ https://api.twitter.com/oauth/request_token POST /oauth/request_token HTTP/1.1 Host: api.twitter.com User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-US,en;q=0.5 Accept

How to open file in Mozilla Add-on SDK using system default application

假如想象 提交于 2020-05-01 07:23:27
问题 Is there any way to initiate opening file in system default application in Add-on SDK environment, or at least in Firefox plugin in general? I'm looking for multi-platform solution, so I'd rather avoid things like platform detection + require("sdk/system/child_process").exec() + ( open , xdg-open , RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL ). Something like Desktop#open from Java world would be ideal. 回答1: The solution is method nsIFile#launch(). Instance of nsIFile based on file path can be

How to open file in Mozilla Add-on SDK using system default application

落爺英雄遲暮 提交于 2020-05-01 07:23:08
问题 Is there any way to initiate opening file in system default application in Add-on SDK environment, or at least in Firefox plugin in general? I'm looking for multi-platform solution, so I'd rather avoid things like platform detection + require("sdk/system/child_process").exec() + ( open , xdg-open , RUNDLL32.EXE SHELL32.DLL,OpenAs_RunDLL ). Something like Desktop#open from Java world would be ideal. 回答1: The solution is method nsIFile#launch(). Instance of nsIFile based on file path can be

Error when installing add-on

ε祈祈猫儿з 提交于 2020-03-26 16:40:11
问题 I'm trying to install my example extension which has the following directory structure. myexample - install.rdf - chrome.manifest - content -- myexample.js -- myexample.xul The file chrome.manifest contains: content myexample chrome/content/ overlay chrome://browser/content/browser.xul chrome://myexample/content/myexample.xul It's pretty minimalist extension. I created a zip file from it: zip -r myexample.xpi myexample/ When installing it in Firefox Tools -> Add-ons -> Install Add-on from

How to add extension in firefox driver in Java using selenium

蹲街弑〆低调 提交于 2020-03-25 04:00:31
问题 How to add extension in firefox driver in selenium in Java Have tried below possibilities. 1st tried Solution FirefoxOptions firefoxOptions = new FirefoxOptions(); FirefoxProfile profile = new FirefoxProfile(); profile.addExtension(new File("/usr/local/bin/foxyproxy_standard-6.6.2-an+fx.xpi")); profile.setPreference("extensions.firebug.currentVersion", "1.8.1"); firefoxOptions.setProfile(profile); WebDriver firefoxDriver = new FirefoxDriver(firefoxOptions); It is not giving any error but it

Mozilla “Jetpack” Add-On: Anchor Panel to Widget

一世执手 提交于 2020-02-20 06:15:28
问题 I'm making a Jetpack extension in which a widget opens a panel. Clicking the widget opens the panel as expected (anchored in the lower-right corner to the widget). But if I call widget.panel.show() from my code, the panel opens detached from the widget, centered in the screen, floating in space. In short, how can I fix this? Can I simulate a click event on the widget (somehow) instead of calling widget.panel.show()? Can I force the panel to anchor to the widget? This question has a solution

Perfom a ShellExecute from Firefox Addon

别来无恙 提交于 2020-02-16 06:49:32
问题 In my Firefox extensions I want to open certain files with the "default viewer" for that file type in Windows. So basically something similar to the ShellExecute('OPEN') function call of the Windows API. Is it possible? If so, how can that be achieved? 回答1: Files The closest thing is nsIFile::launch. However, it is not implemented for every conceivable platform (but it is implemented at least for Windows, OSX, GTK/Gnome and compatible, KDE and Android). You cannot use ::launch to instruct the

Perfom a ShellExecute from Firefox Addon

两盒软妹~` 提交于 2020-02-16 06:49:25
问题 In my Firefox extensions I want to open certain files with the "default viewer" for that file type in Windows. So basically something similar to the ShellExecute('OPEN') function call of the Windows API. Is it possible? If so, how can that be achieved? 回答1: Files The closest thing is nsIFile::launch. However, it is not implemented for every conceivable platform (but it is implemented at least for Windows, OSX, GTK/Gnome and compatible, KDE and Android). You cannot use ::launch to instruct the

Alternative to MutationObserver for synchronous notifications

对着背影说爱祢 提交于 2020-02-06 15:43:05
问题 I need synchronous notifications of DOM changes a la MutationEvents for an extension capability. MutationEvents, however, are deprecated. MutationObserver is limited in usefulness because of the way it aggregates changes and delivers them after the changes have been made. So, simple question. Is synchronous notification of Element style changes possible in current (2019) browser extensions? 回答1: There's no API other than those you've mentioned. The only additional approach is to hook Node