diff --git a/package.json b/package.json index 99324c752..94b407315 100644 --- a/package.json +++ b/package.json @@ -21,12 +21,18 @@ "youtubeAPIKey": "AIzaSyB5_zaen_-46Uhz1xGR-lz1YoUMHqCD6CE", "distBranch": "gh-pages", "uploadPath": "www.4chan-x.net:/var/www/html/", - "matches": [ + "includes_only": [ "*://boards.4chan.org/*", "*://sys.4chan.org/*", "*://www.4chan.org/*", "*://i.4cdn.org/*", - "*://is.4chan.org/*", + "*://is.4chan.org/*" + ], + "matches_only": [ + "*://*.4chan.org/*", + "*://*.4cdn.org/*" + ], + "matches": [ "https://www.google.com/recaptcha/api2/anchor?k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*", "https://www.google.com/recaptcha/api2/frame?*&k=6Ldp2bsSAAAAAAJ5uyx_lx34lJeEpTLVkP5k04qc*", "https://www.google.com/recaptcha/api2/frame?*&k=887877714&*", diff --git a/src/main/Main.coffee b/src/main/Main.coffee index b938e3df4..ec3dabf70 100644 --- a/src/main/Main.coffee +++ b/src/main/Main.coffee @@ -147,6 +147,8 @@ Main = ImageCommon.addControls video return + return unless hostname is 'boards.4chan.org' + if pathname[2] in ['thread', 'res'] g.VIEW = 'thread' g.THREADID = +pathname[3] diff --git a/src/meta/manifest.json b/src/meta/manifest.json index d21925bb9..af5b31144 100644 --- a/src/meta/manifest.json +++ b/src/meta/manifest.json @@ -10,7 +10,7 @@ }, "content_scripts": [{ "js": ["script.js"], - "matches": <%= JSON.stringify(meta.matches) %>, + "matches": <%= JSON.stringify(meta.matches_only.concat(meta.matches)) %>, "exclude_matches": <%= JSON.stringify(meta.exclude_matches) %>, "all_frames": true, "run_at": "document_start" @@ -24,8 +24,7 @@ "key": "<%= meta.appid %>", <% } %> "minimum_chrome_version": "<%= meta.min.chrome %>", "permissions": [ - "storage", - "*://a.4cdn.org/" + "storage" ], "optional_permissions": [ "*://*/" diff --git a/src/meta/metadata.js b/src/meta/metadata.js index f3632c99f..554a86dae 100644 --- a/src/meta/metadata.js +++ b/src/meta/metadata.js @@ -25,7 +25,7 @@ return expand(matches, /^\*/, ['http', 'https']); } return [].concat( - expandMatches(meta.matches).map(function(match) { + expandMatches(meta.includes_only.concat(meta.matches)).map(function(match) { return '// @include ' + match; }), expandMatches(meta.exclude_matches).map(function(match) {