Closed Bug 1792094 Opened 2 months ago Closed 2 months ago

"Attempt to postMessage on disconnected port" when runtime.sendNativeMessage fails to

Categories

(WebExtensions :: General, defect)

defect
Points:
1

Tracking

(firefox107 fixed)

RESOLVED FIXED
107 Branch
Tracking Status
firefox107 --- fixed

People

(Reporter: robwu, Assigned: robwu)

References

Details

(Whiteboard: [addons-jira])

Attachments

(1 file)

Currently, when runtime.sendNativeMessage fails to locate a fitting native messaging host, it emits the error "Attempt to postMessage on disconnected port". This error does not make sense, and does not match the documentation at https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging#troubleshooting

The error happens because of an implementation bug: the actual error is hidden, because the implementation attempts to send a message despite not having found a native messaging host, at https://searchfox.org/mozilla-central/rev/534b95e2e21caaea3e5932fd5a99e4961c942f89/toolkit/components/extensions/NativeMessaging.jsm#342-355

Pushed by rob@robwu.nl:
https://hg.mozilla.org/integration/autoland/rev/4ba6c5182713
Improve accuracy of error reporting by sendNativeMessage r=rpl
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 107 Branch
You need to log in before you can comment on or make changes to this bug.