MV3: `async chrome.runtime.onMessage` listener always returns undefined instead of resolved value

18 views
Skip to first unread message

Adnan Khan

unread,
Feb 10, 2026, 7:13:13 PM (6 hours ago) Feb 10
to Chromium Extensions

We had compalints from customer that some of the features of extension are not working anymore, upon checking, it seems something with message passing has changed that regresses quite features. These features worked just fine from last 2 years but suddenly broken.

I tried to atleast reproduce one method that we are using actively in our extension but not working in standalone extension too

It is for chrome.runtime.onMessage, exactly as documented for Chrome 144+.

The value returned from an async onMessage listener is always received as undefined in the sender, even though the listener resolves to a concrete value.



Version 145.0.7632.46 (Official Build) (64-bit)
OS: Windows



Manifest.json
{
  "manifest_version": 3,
  "name": "Async Message Test",
  "version": "1.0",
  "background": {
    "service_worker": "background.js"
  },
  "content_scripts": [
    {
      "matches": ["https://*/*"],
      "js": ["content_script.js"]
    }
  ]
}


background.js
chrome.runtime.onMessage.addListener(async () => {
  await new Promise(resolve => setTimeout(resolve, 1000));
  return "OK";
});


content_script.js
(async () => {
  const response = await chrome.runtime.sendMessage("test");
  console.log("response:", response);
})();


Let me know if I have to report this into proper channel but I'm looking if I am doing something wrong to fix this issue in my current production extension or I can report this in proper channel as well, thanks!

Reply all
Reply to author
Forward
0 new messages