├── LICENSE
├── README.md
├── images
├── icon128.png
├── icon16.png
├── icon19.png
├── icon19_inactive.png
├── icon38.png
├── icon38_inactive.png
└── icon48.png
├── manifest.json
└── scripts
└── remover.js
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2016 Guillermo Maiolo
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
Remove W3Schools
2 |
3 |
4 |
5 |
6 | Install straight from the Chrome webstore
7 | 
8 |
9 | _Chrome plugin to remove W3Schools results in google searches_
10 |
11 | + **Feel free to open issues or send pull requests for improvements/suggestions/bugs.**
12 |
13 | Manual Installation:
14 |
15 | 1. Clone/download the project
16 | 2. Go to [chrome extensions page](chrome://extensions/)
17 | 3. Click on "Load unpacked extension..." button
18 | 4. Select the project folder
19 | 5. ??
20 | 6. Profit!
21 |
--------------------------------------------------------------------------------
/images/icon128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GMaiolo/remove-w3schools/9c22adc8b85ad73a5ee41609c77e68ad147849ab/images/icon128.png
--------------------------------------------------------------------------------
/images/icon16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GMaiolo/remove-w3schools/9c22adc8b85ad73a5ee41609c77e68ad147849ab/images/icon16.png
--------------------------------------------------------------------------------
/images/icon19.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GMaiolo/remove-w3schools/9c22adc8b85ad73a5ee41609c77e68ad147849ab/images/icon19.png
--------------------------------------------------------------------------------
/images/icon19_inactive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GMaiolo/remove-w3schools/9c22adc8b85ad73a5ee41609c77e68ad147849ab/images/icon19_inactive.png
--------------------------------------------------------------------------------
/images/icon38.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GMaiolo/remove-w3schools/9c22adc8b85ad73a5ee41609c77e68ad147849ab/images/icon38.png
--------------------------------------------------------------------------------
/images/icon38_inactive.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GMaiolo/remove-w3schools/9c22adc8b85ad73a5ee41609c77e68ad147849ab/images/icon38_inactive.png
--------------------------------------------------------------------------------
/images/icon48.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/GMaiolo/remove-w3schools/9c22adc8b85ad73a5ee41609c77e68ad147849ab/images/icon48.png
--------------------------------------------------------------------------------
/manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "author": "Guillermo Maiolo",
3 | "manifest_version": 3,
4 | "name": "Remove W3Schools",
5 | "description": "Remove W3Schools results in google searches",
6 | "version": "3.0.24",
7 | "icons": {
8 | "128": "images/icon128.png",
9 | "48": "images/icon48.png",
10 | "16": "images/icon16.png"
11 | },
12 | "content_scripts": [
13 | {
14 | "js": [
15 | "scripts/remover.js"
16 | ],
17 | "matches": [
18 | "*://*.google.com/*",
19 | "*://*.google.ad/*",
20 | "*://*.google.ae/*",
21 | "*://*.google.com.af/*",
22 | "*://*.google.com.ag/*",
23 | "*://*.google.com.ai/*",
24 | "*://*.google.al/*",
25 | "*://*.google.am/*",
26 | "*://*.google.co.ao/*",
27 | "*://*.google.com.ar/*",
28 | "*://*.google.as/*",
29 | "*://*.google.at/*",
30 | "*://*.google.com.au/*",
31 | "*://*.google.az/*",
32 | "*://*.google.ba/*",
33 | "*://*.google.com.bd/*",
34 | "*://*.google.be/*",
35 | "*://*.google.bf/*",
36 | "*://*.google.bg/*",
37 | "*://*.google.com.bh/*",
38 | "*://*.google.bi/*",
39 | "*://*.google.bj/*",
40 | "*://*.google.com.bn/*",
41 | "*://*.google.com.bo/*",
42 | "*://*.google.com.br/*",
43 | "*://*.google.bs/*",
44 | "*://*.google.bt/*",
45 | "*://*.google.co.bw/*",
46 | "*://*.google.by/*",
47 | "*://*.google.com.bz/*",
48 | "*://*.google.ca/*",
49 | "*://*.google.cd/*",
50 | "*://*.google.cf/*",
51 | "*://*.google.cg/*",
52 | "*://*.google.ch/*",
53 | "*://*.google.ci/*",
54 | "*://*.google.co.ck/*",
55 | "*://*.google.cl/*",
56 | "*://*.google.cm/*",
57 | "*://*.google.cn/*",
58 | "*://*.google.com.co/*",
59 | "*://*.google.co.cr/*",
60 | "*://*.google.com.cu/*",
61 | "*://*.google.cv/*",
62 | "*://*.google.com.cy/*",
63 | "*://*.google.cz/*",
64 | "*://*.google.de/*",
65 | "*://*.google.dj/*",
66 | "*://*.google.dk/*",
67 | "*://*.google.dm/*",
68 | "*://*.google.com.do/*",
69 | "*://*.google.dz/*",
70 | "*://*.google.com.ec/*",
71 | "*://*.google.ee/*",
72 | "*://*.google.com.eg/*",
73 | "*://*.google.es/*",
74 | "*://*.google.com.et/*",
75 | "*://*.google.fi/*",
76 | "*://*.google.com.fj/*",
77 | "*://*.google.fm/*",
78 | "*://*.google.fr/*",
79 | "*://*.google.ga/*",
80 | "*://*.google.ge/*",
81 | "*://*.google.gg/*",
82 | "*://*.google.com.gh/*",
83 | "*://*.google.com.gi/*",
84 | "*://*.google.gl/*",
85 | "*://*.google.gm/*",
86 | "*://*.google.gp/*",
87 | "*://*.google.gr/*",
88 | "*://*.google.com.gt/*",
89 | "*://*.google.gy/*",
90 | "*://*.google.com.hk/*",
91 | "*://*.google.hn/*",
92 | "*://*.google.hr/*",
93 | "*://*.google.ht/*",
94 | "*://*.google.hu/*",
95 | "*://*.google.co.id/*",
96 | "*://*.google.ie/*",
97 | "*://*.google.co.il/*",
98 | "*://*.google.im/*",
99 | "*://*.google.co.in/*",
100 | "*://*.google.iq/*",
101 | "*://*.google.is/*",
102 | "*://*.google.it/*",
103 | "*://*.google.je/*",
104 | "*://*.google.com.jm/*",
105 | "*://*.google.jo/*",
106 | "*://*.google.co.jp/*",
107 | "*://*.google.co.ke/*",
108 | "*://*.google.com.kh/*",
109 | "*://*.google.ki/*",
110 | "*://*.google.kg/*",
111 | "*://*.google.co.kr/*",
112 | "*://*.google.com.kw/*",
113 | "*://*.google.kz/*",
114 | "*://*.google.la/*",
115 | "*://*.google.com.lb/*",
116 | "*://*.google.li/*",
117 | "*://*.google.lk/*",
118 | "*://*.google.co.ls/*",
119 | "*://*.google.lt/*",
120 | "*://*.google.lu/*",
121 | "*://*.google.lv/*",
122 | "*://*.google.com.ly/*",
123 | "*://*.google.co.ma/*",
124 | "*://*.google.md/*",
125 | "*://*.google.me/*",
126 | "*://*.google.mg/*",
127 | "*://*.google.mk/*",
128 | "*://*.google.ml/*",
129 | "*://*.google.com.mm/*",
130 | "*://*.google.mn/*",
131 | "*://*.google.ms/*",
132 | "*://*.google.com.mt/*",
133 | "*://*.google.mu/*",
134 | "*://*.google.mv/*",
135 | "*://*.google.mw/*",
136 | "*://*.google.com.mx/*",
137 | "*://*.google.com.my/*",
138 | "*://*.google.co.mz/*",
139 | "*://*.google.com.na/*",
140 | "*://*.google.com.nf/*",
141 | "*://*.google.com.ng/*",
142 | "*://*.google.com.ni/*",
143 | "*://*.google.ne/*",
144 | "*://*.google.nl/*",
145 | "*://*.google.no/*",
146 | "*://*.google.com.np/*",
147 | "*://*.google.nr/*",
148 | "*://*.google.nu/*",
149 | "*://*.google.co.nz/*",
150 | "*://*.google.com.om/*",
151 | "*://*.google.com.pa/*",
152 | "*://*.google.com.pe/*",
153 | "*://*.google.com.pg/*",
154 | "*://*.google.com.ph/*",
155 | "*://*.google.com.pk/*",
156 | "*://*.google.pl/*",
157 | "*://*.google.pn/*",
158 | "*://*.google.com.pr/*",
159 | "*://*.google.ps/*",
160 | "*://*.google.pt/*",
161 | "*://*.google.com.py/*",
162 | "*://*.google.com.qa/*",
163 | "*://*.google.ro/*",
164 | "*://*.google.ru/*",
165 | "*://*.google.rw/*",
166 | "*://*.google.com.sa/*",
167 | "*://*.google.com.sb/*",
168 | "*://*.google.sc/*",
169 | "*://*.google.se/*",
170 | "*://*.google.com.sg/*",
171 | "*://*.google.sh/*",
172 | "*://*.google.si/*",
173 | "*://*.google.sk/*",
174 | "*://*.google.com.sl/*",
175 | "*://*.google.sn/*",
176 | "*://*.google.so/*",
177 | "*://*.google.sm/*",
178 | "*://*.google.sr/*",
179 | "*://*.google.st/*",
180 | "*://*.google.com.sv/*",
181 | "*://*.google.td/*",
182 | "*://*.google.tg/*",
183 | "*://*.google.co.th/*",
184 | "*://*.google.com.tj/*",
185 | "*://*.google.tk/*",
186 | "*://*.google.tl/*",
187 | "*://*.google.tm/*",
188 | "*://*.google.tn/*",
189 | "*://*.google.to/*",
190 | "*://*.google.com.tr/*",
191 | "*://*.google.tt/*",
192 | "*://*.google.com.tw/*",
193 | "*://*.google.co.tz/*",
194 | "*://*.google.com.ua/*",
195 | "*://*.google.co.ug/*",
196 | "*://*.google.co.uk/*",
197 | "*://*.google.com.uy/*",
198 | "*://*.google.co.uz/*",
199 | "*://*.google.com.vc/*",
200 | "*://*.google.co.ve/*",
201 | "*://*.google.vg/*",
202 | "*://*.google.co.vi/*",
203 | "*://*.google.com.vn/*",
204 | "*://*.google.vu/*",
205 | "*://*.google.ws/*",
206 | "*://*.google.rs/*",
207 | "*://*.google.co.za/*",
208 | "*://*.google.co.zm/*",
209 | "*://*.google.co.zw/*",
210 | "*://*.google.cat/*"
211 | ],
212 | "run_at": "document_idle"
213 | }
214 | ]
215 | }
--------------------------------------------------------------------------------
/scripts/remover.js:
--------------------------------------------------------------------------------
1 | const selectors = {
2 | result_links: '.g div span > a[href*="www.w3schools.com"]',
3 | link_parent_node: "#rso div.g",
4 | main_google_node: "main",
5 | accordion_expander: "g-accordion-expander",
6 | huge_card_on_the_right: "#wp-tabs-container",
7 | };
8 |
9 | function remove() {
10 | const w3SchoolsLinks = Array.from(
11 | document.querySelectorAll(selectors.result_links)
12 | );
13 |
14 | /* ignoring dropdown items and huge card on the right */
15 | const links = w3SchoolsLinks.filter(function (link) {
16 | const isAccordionItem = Boolean(link.closest(selectors.accordion_expander));
17 | const isHugeCardOnTheRight = Boolean(
18 | link.closest(selectors.huge_card_on_the_right)
19 | );
20 |
21 | return !isAccordionItem && !isHugeCardOnTheRight;
22 | });
23 |
24 | links.forEach((el) => {
25 | const parent = el.closest(selectors.link_parent_node);
26 |
27 | if (!parent) {
28 | return console.warn(
29 | "W3SchoolsRemover link selectors need to be updated, please raise an issue!"
30 | );
31 | }
32 |
33 | parent.style.display = "none";
34 | });
35 |
36 | console.info(
37 | `${links.length} W3Schools links were removed from this search.`
38 | );
39 | }
40 |
41 | function init() {
42 | /* avoiding google new tab page and other variations */
43 | const mainGoogleNode = document.getElementById(selectors.main_google_node);
44 |
45 | if (!mainGoogleNode) {
46 | return console.warn(
47 | "W3SchoolsRemover main selector needs to be updated, please raise an issue!"
48 | );
49 | }
50 |
51 | remove();
52 |
53 | const observer = new MutationObserver(remove);
54 | observer.observe(mainGoogleNode, { childList: true, subtree: true });
55 | }
56 |
57 | /**
58 | * may need to tune this timeout in the future
59 | * otherwise we get progressive removals instead of all them together
60 | */
61 | setTimeout(() => {
62 | init();
63 | }, 250);
64 |
--------------------------------------------------------------------------------