How to install extension permanently in geckodriver

Note: OP didn’t specify a language, so this answer is for Python. The other Selenium WebDriver language bindings have similar mechanisms for creating profiles and adding extensions. You can install the Extension each time you instantiate the driver. First, download the extension (XPI file) you want from: https://addons.mozilla.org. Then, in your code… create a FirefoxProfile() … Read more

How do I write a Firefox Addon? [closed]

We tried to make http://developer.mozilla.org/en/Extensions answer all those questions. The first three links in the documentation section are about getting started (that includes Adam’s link). The newsgroup and the irc channel in the Community section are the official discussion boards. Mozilla is very complex, so any kind of API guide would be overwhelming and hard … Read more

Firefox extension .xpi file structure: description, contents, creation, and installation

.xpi file format (Extension Packaging) The .xpi files that are used as containers for Mozilla (Firefox, Thunderbird, etc.) extensions are merely zip archives that have had the file extension changed to .xpi with the files added to the archive using either “deflate” compression, or uncompressed. If you use any other type of compression, other than … Read more

Can a site invoke a browser extension?

Since Chrome introduced externally_connectable, this is quite easy to do in Chrome. First, specify the allowed domain in your manifest.json file: “externally_connectable”: { “matches”: [“*://*.example.com/*”] } Use chrome.runtime.sendMessage to send a message from the page: chrome.runtime.sendMessage(editorExtensionId, {openUrlInEditor: url}, function(response) { // … }); Finally, listen in your background page with chrome.runtime.onMessageExternal: chrome.runtime.onMessageExternal.addListener( function(request, sender, sendResponse) … Read more

On Text Highlight Event?

There isn’t any onhighlightext or anything like that, but a solution would be to bind onmouseup to check if any text is selected if this isn’t in a input/textarea. Edit Here’s an implementation example for you. I only tested this in Chrome/Firefox/IE7. This works in inputs as well. http://jsfiddle.net/qY7gE/ Code from JSFiddle: var t=””; function … Read more

How to use jQuery in Firefox Extension

I use the following example.xul: <?xml version=”1.0″?> <overlay id=”example” xmlns=”http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul”> <head></head> <script type=”application/x-javascript” src=”https://stackoverflow.com/questions/491490/jquery.js”></script> <script type=”application/x-javascript” src=”example.js”></script> </overlay> And here is an example.js (function() { jQuery.noConflict(); $ = function(selector,context) { return new jQuery.fn.init(selector,context||example.doc); }; $.fn = $.prototype = jQuery.fn; example = new function(){}; example.log = function() { Firebug.Console.logFormatted(arguments,null,”log”); }; example.run = function(doc,aEvent) { // Check … Read more

What do {curly braces} around javascript variable name mean [duplicate]

This is what’s known as a destructuring assignment, and it’s a new feature of JavaScript 1.7 (and ECMAScript 6) (Currently, only available as part of the Firefox JavaScript engine.) Roughly, it would translate into this: var ActionButton = require(“sdk/ui/button/action”).ActionButton; It seems silly in this example, as there’s only one item being assigned. However, you’d be … Read more