diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..bbc5374 --- /dev/null +++ b/.gitignore @@ -0,0 +1,9 @@ +# System files +# ------------ + +.DS_Store + +# CSS files +# --------------- + +*.css diff --git a/css/faz.scss b/css/faz.scss new file mode 100644 index 0000000..186b7cf --- /dev/null +++ b/css/faz.scss @@ -0,0 +1,5 @@ +.wm-boycott, +section[data-ct-context="dossier-fussball-wm"] +{ + display: none !important; +} diff --git a/css/spiegel.scss b/css/spiegel.scss new file mode 100644 index 0000000..67f390c --- /dev/null +++ b/css/spiegel.scss @@ -0,0 +1,9 @@ +.wm-boycott, +section[data-area="block>widget>WM 2022 Widget"], +div[data-area="block>topic:fußball-wm_in_katar"], +section[data-area="block>topic:fußball-wm_in_katar"], +section[data-area="block>topic:weltmeisterschaft_in_katar"], +div[data-area="block>sportdaten"] +{ + display: none !important; +} diff --git a/css/sz.scss b/css/sz.scss new file mode 100644 index 0000000..24dab7e --- /dev/null +++ b/css/sz.scss @@ -0,0 +1 @@ +.wm-boycott{display:none !important} \ No newline at end of file diff --git a/css/tagesspiegel.scss b/css/tagesspiegel.scss new file mode 100644 index 0000000..b8c9dc0 --- /dev/null +++ b/css/tagesspiegel.scss @@ -0,0 +1,5 @@ +.wm-boycott, +div[data-pym-src^="https://embed.dpa-sportslive.com"] +{ + display: none !important; +} diff --git a/css/zeit.scss b/css/zeit.scss new file mode 100644 index 0000000..9941e67 --- /dev/null +++ b/css/zeit.scss @@ -0,0 +1,6 @@ +.wm-boycott, +section[data-ct-context="dossier-fussball-wm"], +.wm-ticker, +{ + display: none !important; +} diff --git a/images/icon-128.png b/images/icon-128.png new file mode 100644 index 0000000..70e3187 Binary files /dev/null and b/images/icon-128.png differ diff --git a/images/icon-16.png b/images/icon-16.png new file mode 100644 index 0000000..552eb62 Binary files /dev/null and b/images/icon-16.png differ diff --git a/images/icon-32.png b/images/icon-32.png new file mode 100644 index 0000000..fc8a9b0 Binary files /dev/null and b/images/icon-32.png differ diff --git a/images/icon-48.png b/images/icon-48.png new file mode 100644 index 0000000..65e1c77 Binary files /dev/null and b/images/icon-48.png differ diff --git a/images/icon-64.png b/images/icon-64.png new file mode 100644 index 0000000..852d8af Binary files /dev/null and b/images/icon-64.png differ diff --git a/js/faz.js b/js/faz.js new file mode 100644 index 0000000..9f2b21a --- /dev/null +++ b/js/faz.js @@ -0,0 +1,7 @@ +const selectors = [ + 'article', + '.o-ModuleWrapper', + '.lay-MegaMenu_SubsectionItem' +] + +searchAndHide(selectors, regex); diff --git a/js/main.js b/js/main.js new file mode 100644 index 0000000..ccc0d91 --- /dev/null +++ b/js/main.js @@ -0,0 +1,34 @@ +const keywords = [ + 'WM', + 'WM-Auftakt', + 'WM-Premiere', + 'Weltmeisterschaft', + 'Fußball-WM', + 'Fußball-Weltmeisterschaft', + 'FIFA', + 'Katar', + 'Qatar', + 'Katars', + 'Qatars', + 'Katarer', + 'Qatarer', + 'Infantino', + 'Nationalmannschaft', + 'DFB-Elf' +]; + +const regexPattern = '(^|\\W)(' + keywords.join('|') + ')($|\\W)'; +const regex = new RegExp(regexPattern); + +function searchAndHide(selectors, regex) { + + const nodes = document.querySelectorAll(selectors.join(',')); + nodes.forEach(node => { + const found = node.innerText.match(regex); + + if(found) { + node.classList.add('wm-boycott'); + } + }); + +} diff --git a/js/spiegel.js b/js/spiegel.js new file mode 100644 index 0000000..5d7c655 --- /dev/null +++ b/js/spiegel.js @@ -0,0 +1,11 @@ +const selectors = [ + 'article', + 'div[data-component="SwiperBar"] .swiper-slide', + '.swiper-wrapper .swiper-slide', + 'div[data-area^="block>podlove"]', + 'div[data-component="AudioPlayerPlaceholderOmny"]', + 'div[data-area="block>margin_column_top"] li', + 'div[data-area="block>shortnews:nachrichten_in_kürze"] li' +]; + +searchAndHide(selectors, regex); diff --git a/js/sz.js b/js/sz.js new file mode 100644 index 0000000..f945144 --- /dev/null +++ b/js/sz.js @@ -0,0 +1,10 @@ +const selectors = [ + 'nav li', + '#sz-newspilot .newsscannermodule__item', + '.sz-pilot li', + '.sz-teaserlist-element', + '.mediabanderole__swiper-wrapper .teaser-item', + '.related-links__container .related-links__item' +]; + +searchAndHide(selectors, regex); diff --git a/js/tagesspiegel.js b/js/tagesspiegel.js new file mode 100644 index 0000000..c851ff3 --- /dev/null +++ b/js/tagesspiegel.js @@ -0,0 +1,8 @@ +const selectors = [ + 'article', + 'section', + '#mainMenuPanel li', + 'footer ul li' +] + +searchAndHide(selectors, regex); diff --git a/js/zeit.js b/js/zeit.js new file mode 100644 index 0000000..80707c0 --- /dev/null +++ b/js/zeit.js @@ -0,0 +1,13 @@ +const selectors = [ + '.zon-teaser-lead__kicker', + '.zon-teaser-standard', + '.zon-teaser-wide', + 'section[data-ct-context="headed-sport"] li', + 'section[data-ct-context="newsticker"] .newsteaser', + '.nav__tags a', + '.sticky-nav__list li', + '.newsletter-signup', + '.zon-teaser-kpi-table', +] + +searchAndHide(selectors, regex); diff --git a/manifest.json b/manifest.json new file mode 100644 index 0000000..06d9859 --- /dev/null +++ b/manifest.json @@ -0,0 +1,77 @@ +{ + "manifest_version": 3, + "name": "WM-Boykott", + "version": "1.0", + "description": "Verbirgt News-Artikel über die Fußballweltmeisterschaft 2022 in Katar auf deutschen News-Websites.", + + "content_scripts": [ + { + "js": [ + "js/main.js", + "js/faz.js" + ], + "css": [ + "css/faz.css" + ], + "matches": [ + "https://*.faz.net/*" + ] + }, + { + "js": [ + "js/main.js", + "js/spiegel.js" + ], + "css": [ + "css/spiegel.css" + ], + "matches": [ + "https://*.spiegel.de/*" + ] + }, + { + "js": [ + "js/main.js", + "js/sz.js" + ], + "css": [ + "css/sz.css" + ], + "matches": [ + "https://*.sueddeutsche.de/*" + ] + }, + { + "js": [ + "js/main.js", + "js/tagesspiegel.js" + ], + "css": [ + "css/tagesspiegel.css" + ], + "matches": [ + "https://*.tagesspiegel.de/*" + ] + }, + { + "js": [ + "js/main.js", + "js/zeit.js" + ], + "css": [ + "css/zeit.css" + ], + "matches": [ + "https://*.zeit.de/*" + ] + } + ], + + "icons": { + "16": "images/icon-16.png", + "32": "images/icon-32.png", + "48": "images/icon-48.png", + "64": "images/icon-64.png", + "128": "images/icon-128.png" + } +} \ No newline at end of file