Closed Bug 616785 Opened 14 years ago Closed 14 years ago

PageMod throws exception when XML document element inserted

Categories

(Add-on SDK Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: myk, Assigned: myk)

References

Details

(Whiteboard: [cherry-pick-1.0b1])

Attachments

(1 file)

PageMod objects throw an exception when the document element for an XML document (like autocomplete.xml, which loads when the awesomebar is activated for the first time) is inserted, since they assume that documents have windows, and XML documents don't have windows: error: An exception occurred. Traceback (most recent call last): File "chrome://global/content/bindings/autocomplete.xml", line 1096, in document.getAnonymousElementByAttribute(this, "anonid", "richlistbox"); File "resource://anonid0-foo-api-utils-lib/observer-service.js", line 174, in this.callback(subject, data); File "resource://anonid0-foo-addon-kit-lib/page-mod.js", line 185, in _onContentWindow if (RULES[rule].test(window.document.URL)) TypeError: window is null Here's a simple fix that ignores documents without windows. At some point we might consider adding support for XML documents, but this at least cleans up the console.
Attachment #495338 - Flags: review?(adw)
Comment on attachment 495338 [details] [diff] [review] patch v1: fixes problem r+, let's land it, but Irakli already had a patch for this in bug 610624.
Attachment #495338 - Flags: review?(adw) → review+
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Whiteboard: [cherry-pick-wanted]
Target Milestone: -- → 1.0b2
Whiteboard: [cherry-pick-wanted] → [cherry-pick-1.0b1]
Target Milestone: 1.0b2 → 1.0b1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: