Skip to content

Migrate native-messaging to MV3 - #617

Open
rebloor wants to merge 4 commits into
mdn:mainfrom
rebloor:native-messaging-to-MV3
Open

rebloor wants to merge 4 commits into
mdn:mainfrom
rebloor:native-messaging-to-MV3

Conversation

@rebloor

@rebloor rebloor commented Jan 20, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@rebloor
rebloor requested a review from a team January 20, 2026 22:46
@rebloor rebloor self-assigned this Jan 20, 2026
@rebloor
rebloor requested review from willdurand and removed request for a team January 20, 2026 22:46
@willdurand willdurand changed the title M\igrate native-messaging to MV3 Migrate native-messaging to MV3 Jan 21, 2026

@willdurand willdurand left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r+wc, makes sure to fix the typo in the commit title (I fixed the PR title)

@rebloor
rebloor force-pushed the native-messaging-to-MV3 branch from 1ce9833 to 02212cb Compare January 21, 2026 16:27
Comment thread native-messaging/add-on/background.js Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rob--W update to use the popup, but not make Chrome compatible due to the extension ID issue.

@rebloor
rebloor requested a review from a team as a code owner September 4, 2026 19:17
@rebloor
rebloor requested a review from Rob--W September 4, 2026 19:17

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants