Closed Bug 390215 Opened 13 years ago Closed 10 years ago
Toolkit Issue - navigator-toolbox accepts a new toolbarbutton but fails to wrap it for use by the Customize
80.42 KB, text/html
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a7pre) Gecko/2007072605 Minefield/3.0a7pre Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a7pre) Gecko/2007072605 Minefield/3.0a7pre 1. An attempt to create or install a new custombutton (toolbarbutton) at runtime via the navigator-toolbox appendChild method fails to properly wrap the object and make it available to the Customize... dialog. 2. Upon attempting to open the Customize... dialog the following error is thrown: 1. Error: Illegal operation on WrappedNative prototype object = NS_ERROR_XPC_BAD_OP_ON_WN_PROTO Source file: chrome://global/content/customizeToolbar.js Line: 439 3. The new custombutton is NOT present in the dialog. 4. Retrieving the button from the toolbox.palette. Yields the correct object with it's properties intact. 5. Closing and re-starting the browser seems to properly wrap and populate the Customize... dialog (the new button IS present) and no errors or exceptions are reported when the Customize... dialog is opened. 6. The following Error: Error: uncaught exception: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIObserverService.removeObserver]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://browser/content/search/search.xml :: :: line 115" data: no] is thrown with or without Custom Buttons² installed. (It is not the focus of this topic.) Reproducible: Always Steps to Reproduce: In a new/clean profile: 1. Install Custom Buttons² extension ( provided in the attachments). 2. Open the Error Console. 1. Tools > Error Console. 2. Size FF and position the 2 windows so Error console can be seen even when not focused. 3. Create a new custombutton by: 1. Select View > Add New Button... 2. Name the button "Whatever..." 3. Click the OK button. 4. Button "Whatever..."successfully created appears. 5. Click the OK button. 6. Select View > Toolbars > Customize... Error: Illegal operation on WrappedNative prototype object = NS_ERROR_XPC_BAD_OP_ON_WN_PROTO Source file: chrome://global/content/customizeToolbar.js Line: 439 is thrown. 7. New custombutton NOT present in the Customize... dialog. 4. This behavior is different than version 184.108.40.206 and earlier which will execute the same code successfully.. Actual Results: Error: Illegal operation on WrappedNative prototype object = NS_ERROR_XPC_BAD_OP_ON_WN_PROTO Source file: chrome://global/content/customizeToolbar.js Line: 439 is thrown. New custombutton NOT present in the Customize... dialog. Expected Results: No error thrown. New custombutton present in the Customize... dialog. Enabled Extensions:  - Custom Buttons² 220.127.116.11b02a: http://custombuttons2.com - The Custom Buttons² Firefox extension provides the code base support necessary to create, maintain, import, and export custom toolbar buttons. These custom buttons can be written to do various tasks that the user may require. - DOM Inspector 1.9a7pre: http://www.mozilla.org/projects/inspector/ - Inspects the structure and properties of a window and its contents. Disabled Extensions:  - AI Roboform Toolbar for Firefox 6.9.3: http://www.roboform.com - Allows the use of Roboform in Firefox. Installed Themes:  - Firefox (default): http://www.mozilla.org/ I am aware this may actually be a security measure but it breaks Custom Buttons² and there is no clear path forward if that is the case. A kludge workaround of maintaining a separate custombutton palette for newly installed/created buttons seems to smack of poor design and is fraught with potential risks regarding the user creating/installing many custombuttons while also deleting ones already in the navigator-toolbox and populating the toolbars with out re-starting. I've provided a custombutton packaged in Button Palette Test.html which is included in the attachments. This button (after re-start) will retrieve the button created above and clone it changing the name and id # then attempt to install it as above via the gtoolbox.appendChild method. It then verifies the button's presence in the navigator-toolbox.palette by retrieving the newly installed button and reporting it's name and id via an alert. I am providint the following links to files that might prove helpful in demonstrating the issue and proving the new button is added to the palette. 1. http://bellsouthpwp.net/d/u/dunham_g//BugAttach/Attach.zip Includes all needed files and a profile with everything set up to demonstrate. 2. http://bellsouthpwp.net/d/u/dunham_g//BugAttach/Button%20Palette%20Test.html A button to demonstrate the bug/feature and also prove the new button got created and arrived in the palette. 3. http://bellsouthpwp.net/d/u/dunham_g//BugAttach/Current.xpi The Extension xpi especially arranged to load into Minefield. I noted Major below and understand others may see it different.
Because the file I tried to attach was too large I've included links elsewhere.
Attachment #274536 - Attachment filename: Button Palette Test.html
Ria Klaassen Related seems accurate. It may also qualify as a dup. I've tried the disable suggestion in <a href="Bug 363383">Bug 363383</a> the button does seem to appear in the Customize... dialog and the error still gets generated.
Ok, so lets dupe against bug 363383.
Status: UNCONFIRMED → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 363383
You need to log in before you can comment on or make changes to this bug.