tabs.sendMessage(badid, msg) = "An unexpected error occurred" + "tab is null" instead of "Could not establish connection. Receiving end does not exist."
Categories
(WebExtensions :: General, defect, P3)
Tracking
(firefox-esr78 unaffected, firefox82 wontfix, firefox83 fixed)
| Tracking | Status | |
|---|---|---|
| firefox-esr78 | --- | unaffected |
| firefox82 | --- | wontfix |
| firefox83 | --- | fixed |
People
(Reporter: robwu, Assigned: onlinericha19, Mentored)
References
(Regression)
Details
(Keywords: good-first-bug, regression)
Attachments
(1 file)
browser.tabs.sendMessage(12345, "msg"); used to reject with:
"Could not establish connection. Receiving end does not exist."
but now it rejects with:
"An unexpected error occurred"
and the global JS console shows:
tab is null ExtensionParent.jsm:309
getTopBrowsingContextId resource://gre/modules/ExtensionParent.jsm:309
normalizeArgs resource://gre/modules/ExtensionParent.jsm:324
We should fix this, by:
- adding a check for
!tabto https://searchfox.org/mozilla-central/rev/f4b4008f5ee00f5afa3095f48c54f16828e4b22b/toolkit/components/extensions/ExtensionParent.jsm#309 - updating the unit test to use
browser.test.assertRejectsinstead of the non-functional test at https://searchfox.org/mozilla-central/rev/f4b4008f5ee00f5afa3095f48c54f16828e4b22b/browser/components/extensions/test/browser/browser_ext_tabs_sendMessage.js#363-369 . That current test is not doing anything becausebrowser.tabs.sendMessage is async, so thetry-catch` does not catch the rejection.
| Reporter | ||
Comment 2•9 months ago
|
||
Fixing this is very doable for beginners (with the steps mentioned above), I'll mentor this bug.
To get started, see https://wiki.mozilla.org/WebExtensions/Contribution_Onramp
Updated•9 months ago
|
| Reporter | ||
Updated•9 months ago
|
| Assignee | ||
Comment 3•8 months ago
|
||
I would like to give this a shot. Setting up the dev environment right now would try to have a patch ready soon.
| Assignee | ||
Comment 4•8 months ago
|
||
Updated•8 months ago
|
Pushed by rmaries@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/37f7e8b9f72b Throw no receiver error if tab is not available. r=robwu
Comment 6•8 months ago
|
||
| bugherder | ||
Comment 7•8 months ago
|
||
Thanks so much, Richa! 🎉 Your contribution has been added to our recognition wiki: https://wiki.mozilla.org/Add-ons/Contribute/Recognition
Welcome onboard! We look forward to seeing you around. 😎
Updated•7 months ago
|
Description
•