Skip to content

Commit 9e59de9

Browse files
committed
extension: Reuse exclude_matches from the manifest
1 parent 6e6cda0 commit 9e59de9

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

web/packages/extension/manifest.json5

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"content_scripts": [
1414
{
1515
"matches": ["<all_urls>"],
16+
// Note: This array is directly referenced by background.ts
1617
"exclude_matches": [
1718
"https://sso.godaddy.com/*", // See https://github.com/ruffle-rs/ruffle/pull/7146
1819
"https://authentication.td.com/*", // See https://github.com/ruffle-rs/ruffle/issues/2158

web/packages/extension/src/background.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,18 +175,9 @@ async function enable() {
175175
return;
176176
}
177177
if (!(await contentScriptRegistered())) {
178-
const excludeMatches = [
179-
"https://sso.godaddy.com/*", // See https://github.com/ruffle-rs/ruffle/pull/7146
180-
"https://authentication.td.com/*", // See https://github.com/ruffle-rs/ruffle/issues/2158
181-
"https://*.twitch.tv/*", // See https://github.com/ruffle-rs/ruffle/pull/8150
182-
"https://www.tuxedocomputers.com/*", // See https://github.com/ruffle-rs/ruffle/issues/11906
183-
"https://*.taobao.com/*", // See https://github.com/ruffle-rs/ruffle/pull/12650
184-
"https://*.time4learning.com/*", // See https://github.com/ruffle-rs/ruffle/pull/16186
185-
"https://*.edgenuity.com/*", // See https://github.com/ruffle-rs/ruffle/pull/16186
186-
"https://www.chewy.com/*", // See https://github.com/ruffle-rs/ruffle/issues/18265
187-
"https://*.duosecurity.com/*", // See https://github.com/ruffle-rs/ruffle/pull/18299
188-
"https://*.tiktok.com/*", // See https://github.com/ruffle-rs/ruffle/pull/20250
189-
];
178+
// Reuse the exclude_matches of dist/content.js in the manifest.
179+
const excludeMatches =
180+
utils.runtime.getManifest().content_scripts![0]!.exclude_matches!;
190181
await utils.scripting.registerContentScripts([
191182
{
192183
id: "ruffle",

0 commit comments

Comments
 (0)