Skip to main content

Bug Tracker

Side navigation

#4865 closed bug (invalid)

Opened July 07, 2009 06:09PM UTC

Closed October 09, 2010 02:37AM UTC

Last modified March 15, 2012 03:59PM UTC

JQuery 1.3.2 breaks modal plugins in Firefox Toolbar extensions

Reported by: nopuck4you Owned by:
Priority: critical Milestone: 1.4
Component: core Version: 1.3.2
Keywords: Cc:
Blocked by: Blocking:
Description

I get errors such as HS, or H, or L is undefined whenever I try to use modal dialogs from within a Firefox toolbar extension. At first I thought it was an issue with jqModal but then I tried nyroModal and it too breaks with errors. I original had jqModal working with JQuery 1.2.6 but upgraded so I could use the live() function.

I have example code posted on stackoverflow.com @: http://stackoverflow.com/questions/1081300/jqmodal-and-nyromodal-will-not-work-w-jquery-1-3-2-and-firefox-toolbar-extension

I've tried to attach JQuery and JQModal in many variations - within XUL, attached to Head, dynamically loaded - all approaches generate errors unless I go back to 1.2.6 version of JQuery.

Attachments (0)
Change History (3)

Changed August 24, 2009 02:42PM UTC by marcusb comment:1

I have found that jQuery 1.3.2 breaks any XUL dialogs in my Firefox extension, wherease jQuery 1.2.6 works.

A simple way to test this is to install the "Extension Developer" extension in Firefox, go to Tools -> Extension Developer -> XUL Editor and paste in the following snippet.

<?xml version="1.0"?>
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"/>
    <textbox/>
</dialog>

This will show Cancel and OK buttons in the preview area, but not the text box.

Then try with jQuery 1.2.6 instead, and see that the text box is now visible:

<?xml version="1.0"?>
<dialog xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js" type="text/javascript"/>
    <textbox/>
</dialog>

Changed September 11, 2009 01:08PM UTC by bridget.almas comment:2

I think this is caused by a Firefox bug, related to references to document.documentElement in XUL dialogs. See https://bugzilla.mozilla.org/show_bug.cgi?id=381168

Changed October 09, 2010 02:37AM UTC by addyosmani comment:3

resolution: → invalid
status: newclosed

References: #4865, #4443 (duplicates)

Both tickets describe jQuery as being the source of a compatibility issue within XUL-based FireFox extensions. This was a known issue with FireFox which was sourced back to the way it handles the document.documentElement element from within these extensions. As it transpires, there are actually conventions in the way jQuery should be loaded for extensions (this isn't a core bug).

A common practice to correctly use jQuery in extensions was to until after 'load' (using a DOMContentLoaded listener) to execute any further code as this prevented further issues related to this bug from appearing.