Skip to content

Commit d64627b

Browse files
authored
fix(background): avoid duplicate polyfill script warning (#1030)
1 parent 9725c5f commit d64627b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/background/services/background.ts

+4
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,13 @@ export class Background {
9292
js: ['polyfill/polyfill.js'],
9393
matches: this.browser.runtime.getManifest().host_permissions,
9494
runAt: 'document_start',
95+
persistAcrossSessions: false,
9596
},
9697
]);
9798
} catch (error) {
99+
if (/duplicate/i.test(error.message)) {
100+
return;
101+
}
98102
// Firefox <128 will throw saying world: MAIN isn't supported. So, we'll
99103
// inject via contentScript later. Injection via contentScript is slow,
100104
// but apart from WM detection on page-load, everything else works fine.

0 commit comments

Comments
 (0)