|
Post by Peter on May 27, 2011 23:45:07 GMT -5
Menu Editor v1.2.7 and GrabMyBooks v1.1 extensions trigger the following error each time a new window (not tab) opens:
[JavaScript Application] TypeError: document.popupNode is null::1927
Firefox version: 4.0.1 Build identifier: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
Test procedure: - Shift-click Firefox shortcut to open in Safe Mode - Disable all add-ons - Reset toolbars and controls - Reset all user preferences to Firefox defaults - Make Changes and Restart - Open Add-ons - Enable Menu Editor and GrabMyBooks - Restart Firefox
JavaScript error dialog pops up immediately after main window opens. Subsequent new windows (not tabs) also trigger the same error. Restart Firefox and the same thing happens again. No errors with either extension enabled by itself.
Thanks for looking into this...
|
|
|
Post by Peter on May 28, 2011 4:03:27 GMT -5
I think I found the problem in the grabMyBooks.showFirefoxContextMenu() declaration of grabMyBooks.js. I edited a copy of the .js file, adding a check for a null value (lines 5, 6, 10, and 24 in the code below), and then added the updated .js file to my installed copy of the .xpi. This has solved the problem with the JavaScript warning dialog in Firefox, and GrabMyBooks seems to be working as expected.
Not sure if there's any fix you can add to Menu Editor to work around this apparent problem in GrabMyBooks...
grabMyBooks.showFirefoxContextMenu = function (event) { try { var toShow = false; var node = null; node = document.popupNode; if (node != null) { if (document.popupNode.localName.toUpperCase() == "A") { node = document.popupNode; } else if (document.popupNode.localName.toUpperCase() == "IMG") { node = document.popupNode.parentNode; // was var node = document.popupNode.parentNode; } if (node != null) { toShow = grabMyBooks.isValidNode(node); grabMyBooks.articleLink = node.href; } else { grabMyBooks.articleLink = null; } var aGrabMyBookPageIsOnSelectedTab = ((grabMyBooks.bookTab != null && gBrowser.selectedTab == grabMyBooks.bookTab) || (grabMyBooks.optionState.tab != null && gBrowser.selectedTab == grabMyBooks.optionState.tab) || (grabMyBooks.feeds.tab != null && gBrowser.selectedTab == grabMyBooks.feeds.tab)); document.getElementById("grabMyBooksGrabMyBook").hidden = aGrabMyBookPageIsOnSelectedTab; document.getElementById("grabMyBooksGrabPage").hidden = aGrabMyBookPageIsOnSelectedTab; document.getElementById("grabMyBooksGrabLink").hidden = !toShow || aGrabMyBookPageIsOnSelectedTab; document.getElementById("grabMyBooksGrabSelection").hidden = !grabMyBooks.isSomethingSelected() || aGrabMyBookPageIsOnSelectedTab; } } catch (e) { alert(e + '::' + e.lineNumber); } };
|
|