You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What information was incorrect, unhelpful, or incomplete?
Returning a Promise is now preferred, as sendResponse() will be removed from the W3C spec
nee to update the example to use a promise - sendResponse({response: "Response from background script"});
rebloor
added
P3
and removed
needs triage
Triage needed by staff and/or partners. Automatically applied when an issue is opened.
labels
Aug 2, 2021
sideshowbarker
changed the title
Issue with "runtime.sendMessage()": (short summary here please)
Issue with "runtime.sendMessage()": update example: returning a Promise is now preferred, as sendResponse() will be removed from the W3C spec
Feb 17, 2022
MDN URL: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/sendMessage
What information was incorrect, unhelpful, or incomplete?
Returning a Promise is now preferred, as sendResponse() will be removed from the W3C spec
nee to update the example to use a promise - sendResponse({response: "Response from background script"});
Specific section or headline?
https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/runtime/sendMessage#examples
What did you expect to see?
example that complies with current recommendations
Did you test this? If so, how?
the example code results in a warning:
browser-polyfill.js:1075 Returning a Promise is the preferred way to send a reply from an onMessage/onMessageExternal listener, as the sendResponse will be removed from the specs (See https://developer.mozilla.org/docs/Mozilla/Add-ons/WebExtensions/API/runtime/onMessage)
MDN Content page report details
en-us/mozilla/add-ons/webextensions/api/runtime/sendmessage
The text was updated successfully, but these errors were encountered: