diff --git a/builds/appchan-x.meta.js b/builds/appchan-x.meta.js index 6170b64d1..a6dfac7c7 100644 --- a/builds/appchan-x.meta.js +++ b/builds/appchan-x.meta.js @@ -6,6 +6,7 @@ // @namespace zixaphir // @description The most comprehensive 4chan userscript. // @license MIT; https://github.com/zixaphir/appchan-x/blob/master/LICENSE +// @match *://*.4chan.org/* // @match *://boards.4chan.org/* // @match *://sys.4chan.org/* // @match *://a.4cdn.org/* diff --git a/builds/appchan-x.user.js b/builds/appchan-x.user.js index 61cafd197..9f633f892 100644 --- a/builds/appchan-x.user.js +++ b/builds/appchan-x.user.js @@ -7,6 +7,7 @@ // @namespace zixaphir // @description The most comprehensive 4chan userscript. // @license MIT; https://github.com/zixaphir/appchan-x/blob/master/LICENSE +// @match *://*.4chan.org/* // @match *://boards.4chan.org/* // @match *://sys.4chan.org/* // @match *://a.4cdn.org/* @@ -14134,11 +14135,18 @@ } }, remStyle: function() { - var item, _i, _len, _ref; - _ref = [$('[title="switch"]', d.head), $('[href="//s.4cdn.org/css/yotsubluemobile.540.css"]', d.head), $.id('base-css'), $.id('mobile-css')]; + var item, _i, _j, _len, _len1, _ref, _ref1; + _ref = ['[title="switch"]', '[href="//s.4cdn.org/css/yotsubluemobile.540.css"]', '#base-css', '#mobile-css']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; - if (item) { + if (item = $(item, d.head)) { + item.disabled = true; + } + } + if (g.VIEW === 'home') { + _ref1 = $$('[rel="stylesheet"], style[type="text/css"]', d.head); + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + item = _ref1[_j]; item.disabled = true; } } @@ -17698,7 +17706,9 @@ switch (location.hostname) { case '4chan.org': case 'www.4chan.org': + g.TYPE = 'sfw'; g.VIEW = 'home'; + Main.setThemeString(); Style.init(); return; case 'a.4cdn.org': diff --git a/builds/crx/manifest.json b/builds/crx/manifest.json index 0f39f1a4f..49b10246f 100644 --- a/builds/crx/manifest.json +++ b/builds/crx/manifest.json @@ -10,7 +10,7 @@ }, "content_scripts": [{ "js": ["script.js"], - "matches": ["*://boards.4chan.org/*","*://sys.4chan.org/*","*://a.4cdn.org/*","*://i.4cdn.org/*"], + "matches": ["*://*.4chan.org/*","*://boards.4chan.org/*","*://sys.4chan.org/*","*://a.4cdn.org/*","*://i.4cdn.org/*"], "all_frames": true, "run_at": "document_start" }], diff --git a/builds/crx/script.js b/builds/crx/script.js index 999ec3844..c25ffff00 100644 --- a/builds/crx/script.js +++ b/builds/crx/script.js @@ -14153,11 +14153,18 @@ } }, remStyle: function() { - var item, _i, _len, _ref; - _ref = [$('[title="switch"]', d.head), $('[href="//s.4cdn.org/css/yotsubluemobile.540.css"]', d.head), $.id('base-css'), $.id('mobile-css')]; + var item, _i, _j, _len, _len1, _ref, _ref1; + _ref = ['[title="switch"]', '[href="//s.4cdn.org/css/yotsubluemobile.540.css"]', '#base-css', '#mobile-css']; for (_i = 0, _len = _ref.length; _i < _len; _i++) { item = _ref[_i]; - if (item) { + if (item = $(item, d.head)) { + item.disabled = true; + } + } + if (g.VIEW === 'home') { + _ref1 = $$('[rel="stylesheet"], style[type="text/css"]', d.head); + for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) { + item = _ref1[_j]; item.disabled = true; } } @@ -17710,7 +17717,9 @@ switch (location.hostname) { case '4chan.org': case 'www.4chan.org': + g.TYPE = 'sfw'; g.VIEW = 'home'; + Main.setThemeString(); Style.init(); return; case 'a.4cdn.org': diff --git a/package.json b/package.json index edc3a812b..104531760 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "buildsPath": "builds/", "mainBranch": "master", "matches": [ + "*://*.4chan.org/*", "*://boards.4chan.org/*", "*://sys.4chan.org/*", "*://a.4cdn.org/*", diff --git a/src/General/Main.coffee b/src/General/Main.coffee index c18cfc38b..004685449 100644 --- a/src/General/Main.coffee +++ b/src/General/Main.coffee @@ -70,7 +70,9 @@ Main = switch location.hostname when '4chan.org', 'www.4chan.org' + g.TYPE = 'sfw' g.VIEW = 'home' + Main.setThemeString() Style.init() return when 'a.4cdn.org' diff --git a/src/Theming/Style.coffee b/src/Theming/Style.coffee index 4829aff66..7af639932 100644 --- a/src/Theming/Style.coffee +++ b/src/Theming/Style.coffee @@ -62,12 +62,17 @@ Style = remStyle: -> for item in [ - $('[title="switch"]', d.head) - $('[href="//s.4cdn.org/css/yotsubluemobile.540.css"]', d.head) - $.id('base-css') - $.id('mobile-css') + '[title="switch"]' + '[href="//s.4cdn.org/css/yotsubluemobile.540.css"]' + '#base-css' + '#mobile-css' ] - item.disabled = true if item + item.disabled = true if item = $ item, d.head + + if g.VIEW is 'home' + for item in $$ '[rel="stylesheet"], style[type="text/css"]', d.head + item.disabled = true + return generateFilter: (id, values) -> """<%= grunt.file.read('src/General/html/Features/Filters.svg').replace(/>\s+<') %>"""