aboutsummaryrefslogtreecommitdiffstats
path: root/Nettavisen noblink
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-04-24 13:01:04 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-04-24 13:01:04 +0200
commit89cdb9a9f805bf149cacc5a5c2782e6365952e9f (patch)
treea2192324e9197dd609b6e473c6e247e12bb1136d /Nettavisen noblink
parent57dbedd2d496b7b8bfe9b6fa9e89878540eae7ca (diff)
downloaduserscripts-89cdb9a9f805bf149cacc5a5c2782e6365952e9f.tar.gz
userscripts-89cdb9a9f805bf149cacc5a5c2782e6365952e9f.tar.bz2
userscripts-89cdb9a9f805bf149cacc5a5c2782e6365952e9f.zip
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.
Diffstat (limited to 'Nettavisen noblink')
-rw-r--r--Nettavisen noblink/Nettavisen noblink.user.js25
1 files changed, 25 insertions, 0 deletions
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 })