Firefox WebExtension importing Services

The MDN top level page for addons used to give an overview over the different extension types (since FF57 only webextensions are supported). Components.utils.import this is for restartless/XUL (legacy) extensions. const { Cu } = require(“chrome”); this is for SDK extensions. Neither will work in webextensions. Unlike the other extension types webextensions are restrictive, they … Read more

How does Same Origin Policy apply to browser extensions?

The same-origin policy (SOP) appplies to ordinary web pages, not browser extensions, even if they are written in JavaScript. What does “different server” mean when the extension code does not origingate from a server? (The extension script might have some kind of orgin, like chrome-extension://longhashidentificationstr, but not an traditional domain/origin.) To communicate with any Web … Read more

How do you use a firefox plugin within a selenium webdriver program written in java?

Actually you can’t click on the element since it’s not a web page element. However you can create a profile for firefox and include addons in that profile that is launched by the webdriver applications. This will allow you to have access to Firebug or other addons. I’m not sure of the interaction between the … Read more

Is it possible to change the order of list items using CSS3?

You can do it using flexbox. Here’s a fiddle I created for you: https://jsfiddle.net/x56hayht/ ul { display: flex; flex-direction: column; } ul li:first-child { order: 5; } ul li:nth-child(2) { order: 4; } ul li:nth-child(3) { order: 3; } ul li:nth-child(4) { order: 2; } <ul> <li>1</li> <li>2</li> <li>3</li> <li>4</li> <li>5</li> </ul> According to csstricks: … Read more

Add-on “appears to be corrupt” when trying to install my add-on’s .xpi file in Firefox

The .xpi file must use only “deflate” compression or uncompressed The zip implementation within Firefox only supports uncompressed files or files compressed with the “Deflate” algorithm. You will need to create the .zip archive using the compression method “Deflate” instead of the “LZMA” which you are currently using. How to do so will depend on … Read more

How can I fix WebStorm warning “Unresolved function or method” for “require” (Firefox Add-on SDK)

Do you mean that require() is not resolved? You need to either add require.js to your project or enable Node.js Globals predefined library in Settings/Languages and Frameworks/JavaScript/Libraries. (Edited settings path by @yurik) In WebStorm 2016.x-2017.x: make sure that the Node.js Core library is enabled in Settings (Preferences) | Languages & Frameworks | Node.js and NPM … Read more

Controlling a Firefox Extension via Javascript

Yes it possible to interact with other add-ons, given the right circumstances. My test case here will be com.googlecode.sqlitemanager.openInOwnWindow(), which is part of the SqliteManager addon. In newer builds (I’m using Nightly), there is the Browser Toolbox. With it is is as simple as opening a toolbox and executing com.googlecode.sqlitemanager.openInOwnWindow() in the Console. You may … Read more