4

I've encountered posts which have stated, "I'd love to use Extension A but it doesn't work with Extension B". Is this something that I need to be concerned about when building a Firefox extension?

What are some of the common reasons for extensions to conflict with one another? What are the best practices to ensure that my extension plays nicely with all the other extensions?

asked Jan 13, 2009 at 14:05

2 Answers 2

3

The most common reason for extension conflicts is the use of common names in a shared namespace. For example, if two extensions define a global variable named "log" in a browser.xul overlay, only one of them will function as expected, since the other's "log" will be overwritten.

The common solution is learning which of your IDs will be dumped into a shared space and prefixing those with your own unique prefix.

For JavaScript code you could (and it's a good idea anyway) put your code into an object:

var myExtension = {
 onLoad: function() { ... },
 ...
}

instead of

function onLoad() {
}

Here is a pretty good write-up on the topic: http://blog.userstyles.org/2007/02/06/avoiding-extension-conflicts/.

Other conflicts are rare and have to be debugged on a case-by-case basis. For example there used to be a bug in Mozilla that caused event listeners on a node to be lost when the node was moved around the DOM. This caused multiple conflicts for the Menu Editor extension that allowed the user to rearrange menu items.

answered Jan 15, 2009 at 2:05
Sign up to request clarification or add additional context in comments.

Comments

1

Not sure (resource contention is the obvious place to look) but you may have better luck posting to mozilla.dev.extensions

answered Jan 13, 2009 at 14:13

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.