Hi developers,
I have an extension I'm trying to convert (with no little effort) to MV3.
This extension modifies the home page of the browser with the directive:
"chrome_url_overrides": { "newtab": "newpage.html" },I noticed a weird thing using the new Offscreen Document API.
From the SW, on several occasions I need to parse the DOM of an html page that I receive as a response from a fetch command.
When I exchange a message between sender (service worker) and recipient (the offscreen document), that message is delivered to the offscreen document and I get the desired response,
but I noticed that that message
also reaches the runtime.onMessage event handler of the extension page (the new tab) and sometime also reaches the runtime.onMessage event handler of the SW.
The question I ask you at this point is simple. Is this normal behavior?Using runtime.sendMessage shouldn't I get the response only in its callback function or as a return value if I use the promise syntax?
A Minimal, Reproducible Example can be found here:
gitHub Rep