From 89cdb9a9f805bf149cacc5a5c2782e6365952e9f Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 24 Apr 2021 13:01:04 +0200 Subject: Add noblink script for Nettavisen.no. Seems to be much simpler than the myriad of blinkers on Dagbladet.no, hopefully it will stay that way. --- Nettavisen noblink/Nettavisen noblink.user.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Nettavisen noblink/Nettavisen noblink.user.js (limited to 'Nettavisen noblink') diff --git a/Nettavisen noblink/Nettavisen noblink.user.js b/Nettavisen noblink/Nettavisen noblink.user.js new file mode 100644 index 0000000..080d2bc --- /dev/null +++ b/Nettavisen noblink/Nettavisen noblink.user.js @@ -0,0 +1,25 @@ +// ==UserScript== +// @name Nettavisen noblink +// @namespace snake66 +// @description Remove annoying blinking backgrounds and animated marquees at nettavisen.no. +// @include https://*.nettavisen.no/* +// @version 1 +// @grant none +// ==/UserScript== + +let nettavisen_blink_classes = [ + 'optimus-element-sonar', +] + +function nettavisen_noblink() +{ + for (let cls of nettavisen_blink_classes) { + for (let blinker of document.getElementsByClassName(cls)) { + console.log("Trying to remove blinker: " + blinker.toString()) + blinker.remove() + } + } +} + +let nettavisen_obsrvr = new MutationObserver(nettavisen_noblink) +nettavisen_obsrvr.observe(document, { attributes: true, childList: true, subtree: true }) -- cgit v1.2.3