Bug Tracker

Opened 10 years ago

Closed 9 years ago

Last modified 8 years ago

#4865 closed bug (invalid)

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.

Change History (3)

comment:1 Changed 10 years ago by marcusb

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>

comment:2 Changed 10 years ago by bridget.almas

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

comment:3 Changed 9 years ago by addyosmani

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.

Note: See TracTickets for help on using tickets.