TypeError: this.browser is null in ExtensionPopups.jsm when extension popup is closed on load
Categories
(WebExtensions :: Frontend, defect, P3)
Tracking
(firefox75 verified)
| Tracking | Status | |
|---|---|---|
| firefox75 | --- | verified |
People
(Reporter: robwu, Assigned: robwu)
References
Details
Attachments
(3 files, 1 obsolete file)
| Assignee | ||
Comment 1•8 years ago
|
||
Updated•8 years ago
|
Updated•7 years ago
|
Test case -
install Cliqz extension from AMO, open browser action and click close button in the popup
Following error is observed in console:
TypeError: can't access property "ownerGlobal", browser is null in BrowserElementParent.jsm:81:21
This happens whenever window.close() is called from script within browser action popup.
| Assignee | ||
Comment 3•6 years ago
•
|
||
I can reproduce the error from comment 2 in Firefox 69 - 74. The error points to https://searchfox.org/mozilla-central/rev/c52d5f8025b5c9b2b4487159419ac9012762c40c/toolkit/actors/BrowserElementParent.jsm#81
In Firefox 68, the test case from the initial report does not trigger any errors. The new error is probably due to the change in bug 1533949 . If I add event.stopPropagation() at https://searchfox.org/mozilla-central/rev/c52d5f8025b5c9b2b4487159419ac9012762c40c/toolkit/components/extensions/ext-browser-content.js#161 , then the error message isn't printed any more.
There is also another error message when the popup is closed (or when the mouse pointer hovers above the extension button and then away):
[Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsIControllers.removeController]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: chrome://global/content/elements/browser-custom-element.js :: destroy :: line 1374" data: no]
There doesn't seem to be any bad side effects besides these errors.
Hi Rob, so what do you suggest,
shall we go ahead and subside the error with event.stopPropagation() ?
I also can not find anything breaking
| Assignee | ||
Comment 5•6 years ago
|
||
I would suggest to either update the condition at https://searchfox.org/mozilla-central/rev/803a42f24c8714631ed81cb824ea1c1a803cb7b8/toolkit/actors/BrowserElementChild.jsm#13
or if that is not feasible, change the implementation to avoid the error at https://searchfox.org/mozilla-central/rev/803a42f24c8714631ed81cb824ea1c1a803cb7b8/toolkit/actors/BrowserElementParent.jsm#81
Updated•6 years ago
|
| Assignee | ||
Comment 8•6 years ago
|
||
Starting from bug 1394019, the DOMWindowClose event is forwarded to the
<browser> element, so there is no need for a custom
"Extension:DOMWindowClose" message any more.
| Assignee | ||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 10•6 years ago
|
||
| bugherder | ||
Comment 11•6 years ago
|
||
Comment 12•6 years ago
|
||
Verified fixed on Windows pro 10 64-bit and MacOS Catalina 10.15 on FF Nightly 75.0a1 (20200213035745) using extensions from description, comment 1 and comment 2. TypeError: browser is null error is no longer received in browser console.
Description
•