aboutsummaryrefslogtreecommitdiffstats
path: root/Dagbladet noblink
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-03-25 19:14:47 +0100
committerHarald Eilertsen <haraldei@anduin.net>2021-03-25 19:16:39 +0100
commit8c40766f401a5f82579eea7a784100e5d6b59a9f (patch)
treea3b65218b0f10dc9c21113f21573d3ec1f89df9a /Dagbladet noblink
parent37d9a5fcb85778c19eb33f5e37a66f74de4fd71a (diff)
downloaduserscripts-8c40766f401a5f82579eea7a784100e5d6b59a9f.tar.gz
userscripts-8c40766f401a5f82579eea7a784100e5d6b59a9f.tar.bz2
userscripts-8c40766f401a5f82579eea7a784100e5d6b59a9f.zip
Update dagbladet noblink script
Adds a few more blinkers, and not detects updates to the DOM, so it should be better at stopping blinking even further down the page.
Diffstat (limited to 'Dagbladet noblink')
-rw-r--r--Dagbladet noblink/Dagbladet noblink.user.js26
1 files changed, 19 insertions, 7 deletions
diff --git a/Dagbladet noblink/Dagbladet noblink.user.js b/Dagbladet noblink/Dagbladet noblink.user.js
index 233a035..5db55dd 100644
--- a/Dagbladet noblink/Dagbladet noblink.user.js
+++ b/Dagbladet noblink/Dagbladet noblink.user.js
@@ -4,15 +4,27 @@
// @description Remove annoying blinking backgrounds and animated marquees at dagbladet.no.
// @include https://*.dagbladet.no/*
// @include https://*.dinside.no/*
-// @version 1
+// @version 2
// @grant none
// ==/UserScript==
-let blink_classes = ['breaking--just-now', 'breaking--pulse-background', 'breaking--pulse-kicker']
+let blink_classes = [
+ 'breaking--just-now',
+ 'breaking--just-now-wave',
+ 'breaking--pulse-background',
+ 'breaking--pulse-kicker',
+ 'breaking--pulsating-dots'
+]
-for (let cls of blink_classes) {
- for (let blinker of document.getElementsByClassName(cls)) {
- //console.log("Disabling marquee on " + blinker.nodeName + " - " + blinker.nodeId)
- blinker.classList.remove(cls)
+function dagbladet_noblink()
+{
+ for (let cls of blink_classes) {
+ for (let blinker of document.getElementsByClassName(cls)) {
+ //console.log("Disabling marquee on " + blinker.nodeName + " - " + blinker.nodeId)
+ blinker.classList.remove(cls)
+ }
}
-} \ No newline at end of file
+}
+
+let dagbladet_obsrvr = new MutationObserver(dagbladet_noblink)
+dagbladet_obsrvr.observe(document, { attributes: true, childList: true, subtree: true })// ==UserScript==