Conversation
willdurand
left a comment
There was a problem hiding this comment.
r+wc, makes sure to fix the typo in the commit title (I fixed the PR title)
1ce9833 to
02212cb
Compare
There was a problem hiding this comment.
In the mdn content article I already mentioned that the example is incompatible with Chrome due to the use of background.scripts without background.service_worker.
Besides that, this updated example demonstrates an anti-pattern.
In MV2 background scripts are long-lived, but in MV3 they are short lived, except when there is extension activity, including when a native messaging application is launched.
Instead of encouraging devs to have a long lived port + native messaging app that would keep their background script alive indefinitely, I recommend to put the logic in the action popup. Then you can render the response from the native app in the popup instead of console.log.
There was a problem hiding this comment.
@Rob--W update to use the popup, but not make Chrome compatible due to the extension ID issue.
Description
This PR migrated the native-messaging example to use Manifest V3. Also include some improvements to the readme file.
Motivation
Manifest V3 is now the recommended manifest version for web extensions.
Related issues and pull requests
Related content changes on MDN mdn/content#42872.