aboutsummaryrefslogtreecommitdiffstats
path: root/Nettavisen noblink/Nettavisen noblink.user.js
blob: 080d2bceb85af4b6d2e402e1cff3c9f68ed5c7b7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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 })