-
Notifications
You must be signed in to change notification settings - Fork 15k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Chrome Extensions service worker host registration #39290
Conversation
Release Notes Persisted
|
I have automatically backported this PR to "26-x-y", please check out #39310 |
I have automatically backported this PR to "24-x-y", please check out #39311 |
I have automatically backported this PR to "25-x-y", please check out #39312 |
This may be a dumb question, but I can't get background scripts to work at all. I found this PR looking for answers-- the fact that this sample exists suggests background scripts should work? But I can't even get this sample to work in I copied this exact sample, loading it into electron-react-boilerplate: app.whenReady().then(async () => {
const ext: Electron.Extension = await session.defaultSession.loadExtension(
'/Users/scottb/github/electron-react-boilerplate/electron-react-boilerplate/mv3-service-worker',
{
allowFileAccess: true,
},
);
console.log(ext)
}) And get this output: {
id: 'ciapjocennpjgkpponngfceicijjbnlc',
name: 'MV3 Service Worker',
path: '/Users/scottb/github/electron-react-boilerplate/electron-react-boilerplate/mv3-service-worker',
url: 'chrome-extension://ciapjocennpjgkpponngfceicijjbnlc/',
version: '1.0',
manifest: {
background: { service_worker: 'background.js' },
content_scripts: [ [Object] ],
description: 'Test for extension service worker support.',
manifest_version: 3,
name: 'MV3 Service Worker',
version: '1.0'
}
}
|
Description of Change
Closes #34178.
Fixes basic Chrome Extension Manifest V3 service worker functionality. Previously, the service worker would register but could not run any chrome APIs:
This fixes that and adds a simple regression test.
Checklist
npm test
passesRelease Notes
Notes: Fixed an issue where service workers could not run Chrome APIs in Chrome Extensions Manifest V3.