Skip to content

Instantly share code, notes, and snippets.

@nielsAD
Last active November 15, 2024 11:33
Show Gist options
  • Select an option

  • Save nielsAD/d04568f2f240a9f0b225897e318bb2a9 to your computer and use it in GitHub Desktop.

Select an option

Save nielsAD/d04568f2f240a9f0b225897e318bb2a9 to your computer and use it in GitHub Desktop.

Revisions

  1. nielsAD revised this gist Nov 15, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions marktplaats.user.js
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    // @name marktplaats
    // @namespace nielsAD
    // @include *://www.marktplaats.nl/*
    // @version 1.2.3
    // @version 1.2.4
    // @grant none
    // @require https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js
    // @require https://cdn.jsdelivr.net/npm/jquery@3.7.1/dist/jquery.min.js
    // ==/UserScript==

    const obs = new MutationObserver(function() {
  2. nielsAD revised this gist Nov 15, 2024. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion marktplaats.user.js
    Original file line number Diff line number Diff line change
    @@ -3,13 +3,14 @@
    // @name marktplaats
    // @namespace nielsAD
    // @include *://www.marktplaats.nl/*
    // @version 1.2.2
    // @version 1.2.3
    // @grant none
    // @require https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js
    // ==/UserScript==

    const obs = new MutationObserver(function() {
    $(".hz-Listings__admarktTitle").hide();
    $(".hz-Listing-seller-name-container .hz-SvgIconCheckmarkCircle").closest("li").hide();
    $(".hz-Listing .hz-Listing-seller-link:not(:empty)").closest("li").hide();
    $(".hz-Listing .hz-Listing-location:contains('Bezorgt in ')").closest("li").hide();
    $(".hz-Listing .hz-Listing-location:contains('Heel Nederland')").closest("li").hide();
  3. nielsAD revised this gist Nov 15, 2024. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions marktplaats.user.js
    Original file line number Diff line number Diff line change
    @@ -3,14 +3,14 @@
    // @name marktplaats
    // @namespace nielsAD
    // @include *://www.marktplaats.nl/*
    // @version 1.2.1
    // @version 1.2.2
    // @grant none
    // @require https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js
    // ==/UserScript==

    const obs = new MutationObserver(function() {
    $(".hz-Listings__admarktTitle").hide();
    $(".hz-Listing .hz-Listing-seller-link").closest("li").hide();
    $(".hz-Listing .hz-Listing-seller-link:not(:empty)").closest("li").hide();
    $(".hz-Listing .hz-Listing-location:contains('Bezorgt in ')").closest("li").hide();
    $(".hz-Listing .hz-Listing-location:contains('Heel Nederland')").closest("li").hide();
    });
  4. nielsAD revised this gist Nov 15, 2024. 1 changed file with 20 additions and 1 deletion.
    21 changes: 20 additions & 1 deletion persgroep.user.js
    Original file line number Diff line number Diff line change
    @@ -2,17 +2,36 @@
    // @description Accept persgroep cookies
    // @name persgroep
    // @namespace nielsAD
    // @include *://www.nu.nl/*
    // @include *://cmp.nu.nl/*
    // @include *://cmp.dpgmedia.nl/*
    // @version 1.0.4
    // @include *://myprivacy-static.dpgmedia.net/*
    // @version 1.1.0
    // @grant none
    // @run-at document-idle
    // ==/UserScript==

    const obs = new MutationObserver(function() {
    const agree = document.querySelector('#notice .pg-accept-button');
    if (agree) {
    obs.disconnect();
    agree.click();
    return;
    }

    const shadow = document.querySelector('#pg-shadow-root-host');
    if (shadow) {
    obs.disconnect();

    const shadow_obs = new MutationObserver(function() {
    const agree = shadow.shadowRoot.querySelector('#pg-accept-btn');
    if (agree) {
    agree.click();
    shadow_obs.disconnect();
    }
    });

    shadow_obs.observe(shadow.shadowRoot, { childList: true });
    }
    });

  5. nielsAD revised this gist Nov 4, 2023. 2 changed files with 7 additions and 26 deletions.
    15 changes: 7 additions & 8 deletions _userscripts.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,12 @@
    User scripts:
    1. [choice.npr](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/choice.npr.user.js)
    2. [ftm.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/followthemoney.user.js)
    3. [kudtcookiewet](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/kudtcookiewet.user.js)
    4. [marktplaats](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/marktplaats.user.js)
    5. [nrc](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/nrc.user.js)
    6. [persgroep](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    7. [privacy-center](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/privacy-center.user.js)
    8. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    9. [youtube](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/youtube.user.js)
    2. [kudtcookiewet](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/kudtcookiewet.user.js)
    3. [marktplaats](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/marktplaats.user.js)
    4. [nrc](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/nrc.user.js)
    5. [persgroep](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    6. [privacy-center](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/privacy-center.user.js)
    7. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    8. [youtube](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/youtube.user.js)

    External:
    1. [YouTube: Age Verification Bypass](https://greasyfork.org/scripts/375525-youtube-age-verification-bypass/code/YouTube:%20Age%20Verification%20Bypass.user.js)
    18 changes: 0 additions & 18 deletions followthemoney.user.js
    Original file line number Diff line number Diff line change
    @@ -1,18 +0,0 @@
    // ==UserScript==
    // @description Hide FTM overlay
    // @name followthemoney
    // @namespace nielsAD
    // @include *://www.ftm.nl/*
    // @version 1.0.1
    // @grant none
    // @run-at document-idle
    // ==/UserScript==

    document.documentElement.style.overflow = "initial";
    document.body.style.overflow = "initial";

    let css = document.createElement("style");
    css.type = 'text/css';
    css.appendChild(document.createTextNode(".modal{display:none}"));

    document.getElementsByTagName("head")[0].appendChild(css);
  6. nielsAD revised this gist Nov 4, 2023. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions followthemoney.user.js
    Original file line number Diff line number Diff line change
    @@ -3,15 +3,16 @@
    // @name followthemoney
    // @namespace nielsAD
    // @include *://www.ftm.nl/*
    // @version 1
    // @version 1.0.1
    // @grant none
    // @run-at document-idle
    // ==/UserScript==

    document.documentElement.style.overflow = "initial";
    document.body.style.overflow = "initial";

    let css = document.createElement("style");
    css.type = 'text/css';
    css.appendChild(document.createTextNode(".blockingOverlay{display:none}"));
    css.appendChild(document.createTextNode(".modal{display:none}"));

    document.getElementsByTagName("head")[0].appendChild(css);
  7. nielsAD revised this gist Nov 4, 2023. 3 changed files with 37 additions and 5 deletions.
    1 change: 1 addition & 0 deletions _userscripts.md
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,7 @@ User scripts:
    2. [ftm.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/followthemoney.user.js)
    3. [kudtcookiewet](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/kudtcookiewet.user.js)
    4. [marktplaats](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/marktplaats.user.js)
    5. [nrc](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/nrc.user.js)
    6. [persgroep](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    7. [privacy-center](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/privacy-center.user.js)
    8. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    27 changes: 27 additions & 0 deletions nrc.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    // ==UserScript==
    // @description Hide NRC overlay
    // @name nrc
    // @namespace nielsAD
    // @include *://www.nrc.nl/*
    // @version 1
    // @grant none
    // @run-at document-idle
    // ==/UserScript==

    document.documentElement.classList.remove("dark-mode");
    document.querySelectorAll("img.b-lazy").forEach(img => {
    const src = img.dataset.src.split("|");
    img.loading = "lazy"
    img.src = src[src.length - 1];
    img.style.maxWidth = "100%";
    img.classList.remove("b-lazy");
    });
    document.querySelectorAll("div.b-lazy").forEach(div => {
    const src = div.dataset.src.split("|");
    const img = document.createElement('img');
    img.loading = "lazy"
    img.src = src[src.length - 1];
    img.style.maxWidth = "100%";
    div.classList.remove("b-lazy");
    div.appendChild(img);
    });
    14 changes: 9 additions & 5 deletions persgroep.user.js
    Original file line number Diff line number Diff line change
    @@ -4,12 +4,16 @@
    // @namespace nielsAD
    // @include *://cmp.nu.nl/*
    // @include *://cmp.dpgmedia.nl/*
    // @version 1.0.3
    // @version 1.0.4
    // @grant none
    // @run-at document-idle
    // ==/UserScript==

    const agree = document.querySelector('#notice .pg-accept-button');
    if (agree) {
    agree.click();
    }
    const obs = new MutationObserver(function() {
    const agree = document.querySelector('#notice .pg-accept-button');
    if (agree) {
    agree.click();
    }
    });

    obs.observe(document.body, { childList: true });
  8. nielsAD revised this gist Aug 15, 2023. 1 changed file with 6 additions and 9 deletions.
    15 changes: 6 additions & 9 deletions persgroep.user.js
    Original file line number Diff line number Diff line change
    @@ -4,15 +4,12 @@
    // @namespace nielsAD
    // @include *://cmp.nu.nl/*
    // @include *://cmp.dpgmedia.nl/*
    // @version 1.0.2
    // @version 1.0.3
    // @grant none
    // @run-at document-idle
    // ==/UserScript==

    const obs = new MutationObserver(function() {
    const agree = document.querySelector('#notice .pg-accept-button');
    if (agree) {
    agree.click();
    }
    });

    obs.observe(document.body, { childList: true });
    const agree = document.querySelector('#notice .pg-accept-button');
    if (agree) {
    agree.click();
    }
  9. nielsAD revised this gist Aug 3, 2023. 3 changed files with 11 additions and 25 deletions.
    1 change: 0 additions & 1 deletion _userscripts.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,6 @@ User scripts:
    2. [ftm.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/followthemoney.user.js)
    3. [kudtcookiewet](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/kudtcookiewet.user.js)
    4. [marktplaats](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/marktplaats.user.js)
    5. [onetrust](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/onetrust.user.js)
    6. [persgroep](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    7. [privacy-center](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/privacy-center.user.js)
    8. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    17 changes: 0 additions & 17 deletions onetrust.user.js
    Original file line number Diff line number Diff line change
    @@ -1,17 +0,0 @@
    // ==UserScript==
    // @description Accept OneTrust cookies
    // @name onetrust
    // @namespace nielsAD
    // @include *://www.nu.nl/*
    // @version 1.0.0
    // @grant none
    // ==/UserScript==

    const obs = new MutationObserver(function() {
    const agree = document.getElementById("onetrust-accept-btn-handler");
    if (agree) {
    agree.click();
    }
    });

    obs.observe(document.body, { childList: true });
    18 changes: 11 additions & 7 deletions persgroep.user.js
    Original file line number Diff line number Diff line change
    @@ -2,13 +2,17 @@
    // @description Accept persgroep cookies
    // @name persgroep
    // @namespace nielsAD
    // @include *://myprivacy.persgroep.net/*
    // @include *://myprivacy.dpgmedia.net/*
    // @version 1.0.1
    // @include *://cmp.nu.nl/*
    // @include *://cmp.dpgmedia.nl/*
    // @version 1.0.2
    // @grant none
    // ==/UserScript==

    const ja = (document.getElementsByClassName("fjs-set-consent") || [])[0];
    if (ja && ja.innerText.indexOf("cookies") !== -1) {
    ja.click();
    }
    const obs = new MutationObserver(function() {
    const agree = document.querySelector('#notice .pg-accept-button');
    if (agree) {
    agree.click();
    }
    });

    obs.observe(document.body, { childList: true });
  10. nielsAD revised this gist Feb 4, 2023. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions marktplaats.user.js
    Original file line number Diff line number Diff line change
    @@ -3,16 +3,16 @@
    // @name marktplaats
    // @namespace nielsAD
    // @include *://www.marktplaats.nl/*
    // @version 1.2.0
    // @version 1.2.1
    // @grant none
    // @require https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js
    // ==/UserScript==

    const obs = new MutationObserver(function() {
    $(".mp-Listings__admarktTitle").hide();
    $(".mp-Listing .mp-Listing-seller-link").closest("li").hide();
    $(".mp-Listing .mp-Listing-location:contains('Bezorgt in ')").closest("li").hide();
    $(".mp-Listing .mp-Listing-location:contains('Heel Nederland')").closest("li").hide();
    $(".hz-Listings__admarktTitle").hide();
    $(".hz-Listing .hz-Listing-seller-link").closest("li").hide();
    $(".hz-Listing .hz-Listing-location:contains('Bezorgt in ')").closest("li").hide();
    $(".hz-Listing .hz-Listing-location:contains('Heel Nederland')").closest("li").hide();
    });

    obs.observe(document.getElementById('__next'), { childList: true, subtree: true });
  11. nielsAD revised this gist Jan 25, 2021. 1 changed file with 5 additions and 5 deletions.
    10 changes: 5 additions & 5 deletions marktplaats.user.js
    Original file line number Diff line number Diff line change
    @@ -3,16 +3,16 @@
    // @name marktplaats
    // @namespace nielsAD
    // @include *://www.marktplaats.nl/*
    // @version 1.1.0
    // @version 1.2.0
    // @grant none
    // @require https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js
    // ==/UserScript==

    const obs = new MutationObserver(function() {
    $(".mp-Listings__admarktTitle").remove();
    $(".mp-Listing .mp-Listing-seller-link").closest("li").remove();
    $(".mp-Listing .mp-Listing-location:contains('Bezorgt in ')").closest("li").remove();
    $(".mp-Listing .mp-Listing-location:contains('Heel Nederland')").closest("li").remove();
    $(".mp-Listings__admarktTitle").hide();
    $(".mp-Listing .mp-Listing-seller-link").closest("li").hide();
    $(".mp-Listing .mp-Listing-location:contains('Bezorgt in ')").closest("li").hide();
    $(".mp-Listing .mp-Listing-location:contains('Heel Nederland')").closest("li").hide();
    });

    obs.observe(document.getElementById('__next'), { childList: true, subtree: true });
  12. nielsAD revised this gist Oct 23, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions youtube.user.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    // @namespace nielsAD
    // @description YouTube theater mode
    // @include *://*.youtube.com/*
    // @version 1.2
    // @version 1.2.1
    // @grant none
    // ==/UserScript==

    @@ -78,7 +78,7 @@ const fun = function(ajaxOpen) {
    // Toggle audio mode on or off
    let audioToggle = document.getElementById("audio-mode");
    audioToggle.onclick = function() {
    let audioMode = localStorage.getItem("ytAudioMode") === "false";
    let audioMode = localStorage.getItem("ytAudioMode") !== "true";
    this.setAttribute("aria-checked", audioMode);
    localStorage.setItem("ytAudioMode", audioMode);
    location.reload();
  13. nielsAD revised this gist Sep 18, 2020. 4 changed files with 19 additions and 17 deletions.
    2 changes: 1 addition & 1 deletion _userscripts.md
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@ User scripts:
    2. [ftm.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/followthemoney.user.js)
    3. [kudtcookiewet](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/kudtcookiewet.user.js)
    4. [marktplaats](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/marktplaats.user.js)
    5. [nu.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/nu.nl.user.js)
    5. [onetrust](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/onetrust.user.js)
    6. [persgroep](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    7. [privacy-center](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/privacy-center.user.js)
    8. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    14 changes: 0 additions & 14 deletions nu.nl.user.js
    Original file line number Diff line number Diff line change
    @@ -1,14 +0,0 @@
    // ==UserScript==
    // @description Accept nu.nl cookies
    // @name nu.nl
    // @namespace nielsAD
    // @include *://www.nu.nl/*
    // @version 1
    // @grant none
    // @run-at document-idle
    // ==/UserScript==

    const ja = document.getElementById("sanoma-consent-accept-button");
    if (ja) {
    ja.click();
    }
    17 changes: 17 additions & 0 deletions onetrust.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,17 @@
    // ==UserScript==
    // @description Accept OneTrust cookies
    // @name onetrust
    // @namespace nielsAD
    // @include *://www.nu.nl/*
    // @version 1.0.0
    // @grant none
    // ==/UserScript==

    const obs = new MutationObserver(function() {
    const agree = document.getElementById("onetrust-accept-btn-handler");
    if (agree) {
    agree.click();
    }
    });

    obs.observe(document.body, { childList: true });
    3 changes: 1 addition & 2 deletions privacy-center.user.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    // @name privacy-center
    // @namespace nielsAD
    // @include *://www.dumpert.nl/*
    // @version 1.0.0
    // @version 1.0.1
    // @grant none
    // ==/UserScript==

    @@ -13,7 +13,6 @@ const obs = new MutationObserver(function() {

    setTimeout(function(){
    const agree = document.getElementById("didomi-notice-agree-button");
    console.log("woop", agree);
    if (agree) {
    agree.click();
    }
  14. nielsAD revised this gist Jul 14, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions _userscripts.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    User scripts:
    1. [choice.npr](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/choice.npr.user.js)
    2. [ftm.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/followthemoney.user.js)
    3. [kudtcookiewet](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/kudtcookiewet.user.js)
  15. nielsAD revised this gist Jul 14, 2020. 2 changed files with 99 additions and 24 deletions.
    6 changes: 4 additions & 2 deletions _userscripts.md
    Original file line number Diff line number Diff line change
    @@ -6,5 +6,7 @@
    6. [persgroep](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    7. [privacy-center](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/privacy-center.user.js)
    8. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    9. [YouTube: Theater Mode](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/youtube.user.js)
    10. [YouTube: Age Verification Bypass](https://greasyfork.org/scripts/375525-youtube-age-verification-bypass/code/YouTube:%20Age%20Verification%20Bypass.user.js)
    9. [youtube](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/youtube.user.js)

    External:
    1. [YouTube: Age Verification Bypass](https://greasyfork.org/scripts/375525-youtube-age-verification-bypass/code/YouTube:%20Age%20Verification%20Bypass.user.js)
    117 changes: 95 additions & 22 deletions youtube.user.js
    Original file line number Diff line number Diff line change
    @@ -1,40 +1,113 @@
    // ==UserScript==
    // @name YouTube: Theater Mode
    // @name youtube
    // @namespace nielsAD
    // @description YouTube theater mode
    // @include *://www.youtube.com/*
    // @version 1.1
    // @include *://*.youtube.com/*
    // @version 1.2
    // @grant none
    // ==/UserScript==

    function resize() {
    const theater = (document.getElementsByClassName("ytp-size-button") || [])[0];
    if (theater && theater.title.indexOf("heater") !== -1) {
    theater.click();
    resized = true;
    const fun = function(ajaxOpen) {
    // ==================================
    // Disable "Are you still there?"
    // ==================================
    yt.util.activity.getTimeSinceActive = function() { return 0; };


    // ================
    // Theater mode
    // ================
    function theaterMode() {
    const theater = (document.getElementsByClassName("ytp-size-button") || [])[0];
    if (theater && theater.title.indexOf("heater") !== -1) {
    theater.click();
    }

    const watch = document.getElementById("page");
    if (watch && watch.classList.contains("watch")) {
    watch.classList.remove("watch-non-stage-mode");
    watch.classList.add("watch-stage-mode");
    watch.classList.add("watch-wide");
    }
    }

    window.addEventListener("yt-navigate-finish", theaterMode);
    theaterMode();


    // ===================
    // Audio-only mode
    // ===================
    function audioMode() {
    if (location.pathname == "/watch") {
    let video = document.getElementsByTagName("video")[0];
    let audioMode = localStorage.getItem("ytAudioMode") === "true";
    addAudioModeToMenu(audioMode);

    const watch = document.getElementById("page");
    if (watch && watch.classList.contains("watch")) {
    watch.classList.remove("watch-non-stage-mode");
    watch.classList.add("watch-stage-mode");
    watch.classList.add("watch-wide");
    resized = true;
    if (audioMode) {
    setPoster(video, ["maxres", "hq", "sd"]);

    XMLHttpRequest.prototype.open = function(method, url) {
    let validStream = /^(?!.*live=1).+audio.+$/;
    if (validStream.test(url) && ! video.src.includes("audio")) {
    video.pause();
    video.src = url.split("&range")[0];
    video.play();
    }
    ajaxOpen.apply(this, arguments);
    }
    }
    }
    }
    }

    window.addEventListener("spfdone", resize);
    window.addEventListener("yt-navigate-finish", resize);
    resize();
    // Add audio mode to the settings menu
    function addAudioModeToMenu(enabled) {
    let panel = document.getElementsByClassName("ytp-panel-menu")[0];
    if (!panel.innerHTML.includes("Audio Mode")) {
    panel.innerHTML += `
    <div class="ytp-menuitem"
    aria-checked="${enabled}"
    id="audio-mode">
    <div class="ytp-menuitem-icon"></div>
    <div class="ytp-menuitem-label">Audio Mode</div>
    <div class="ytp-menuitem-content">
    <div class="ytp-menuitem-toggle-checkbox">
    </div>
    </div>`;

    // Toggle audio mode on or off
    let audioToggle = document.getElementById("audio-mode");
    audioToggle.onclick = function() {
    let audioMode = localStorage.getItem("ytAudioMode") === "false";
    this.setAttribute("aria-checked", audioMode);
    localStorage.setItem("ytAudioMode", audioMode);
    location.reload();
    }
    }
    }

    // Disable "Are you still there?" modal
    const fun = function() {
    yt.util.activity.getTimeSinceActive = function() { return 0; };
    function setPoster(video, fmts) {
    let img = new Image();
    let videoId = location.search.match(/v=(.+?)(&|$)/)[1];
    img.src = `//i.ytimg.com/vi/${videoId}/${fmts.shift()}default.jpg`
    img.onload = function() {
    // A height 90 is YouTube"s not found image.
    if (img.height <= 90) {
    setPoster(video, fmts);
    } else {
    video.style.background = `url(${img.src}) no-repeat center`;
    video.style.backgroundSize = "contain";
    }
    };
    }

    window.addEventListener("yt-navigate-finish", audioMode);
    audioMode();
    };

    window.addEventListener("yt-navigate-finish", function() {
    const node = document.createElement('script');
    node.type = "text/javascript";
    node.textContent = '(' + fun.toString() + ')()';
    node.textContent = '(' + fun.toString() + ')(XMLHttpRequest.prototype.open)';
    document.body.appendChild(node);
    }, {once: true});
  16. nielsAD revised this gist Jul 13, 2020. 1 changed file with 14 additions and 2 deletions.
    16 changes: 14 additions & 2 deletions youtube.user.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    // @namespace nielsAD
    // @description YouTube theater mode
    // @include *://www.youtube.com/*
    // @version 1
    // @version 1.1
    // @grant none
    // ==/UserScript==

    @@ -25,4 +25,16 @@ function resize() {

    window.addEventListener("spfdone", resize);
    window.addEventListener("yt-navigate-finish", resize);
    resize();
    resize();

    // Disable "Are you still there?" modal
    const fun = function() {
    yt.util.activity.getTimeSinceActive = function() { return 0; };
    };

    window.addEventListener("yt-navigate-finish", function() {
    const node = document.createElement('script');
    node.type = "text/javascript";
    node.textContent = '(' + fun.toString() + ')()';
    document.body.appendChild(node);
    }, {once: true});
  17. nielsAD revised this gist Mar 18, 2020. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion _userscripts.md
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,7 @@
    4. [marktplaats](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/marktplaats.user.js)
    5. [nu.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/nu.nl.user.js)
    6. [persgroep](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    7. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    7. [privacy-center](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/privacy-center.user.js)
    8. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    9. [YouTube: Theater Mode](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/youtube.user.js)
    10. [YouTube: Age Verification Bypass](https://greasyfork.org/scripts/375525-youtube-age-verification-bypass/code/YouTube:%20Age%20Verification%20Bypass.user.js)
  18. nielsAD revised this gist Mar 18, 2020. 1 changed file with 23 additions and 0 deletions.
    23 changes: 23 additions & 0 deletions privacy-center.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    // ==UserScript==
    // @description Accept privacy-center cookies
    // @name privacy-center
    // @namespace nielsAD
    // @include *://www.dumpert.nl/*
    // @version 1.0.0
    // @grant none
    // ==/UserScript==

    const obs = new MutationObserver(function() {
    const host = document.getElementById("didomi-host");
    if (!host) return;

    setTimeout(function(){
    const agree = document.getElementById("didomi-notice-agree-button");
    console.log("woop", agree);
    if (agree) {
    agree.click();
    }
    }, 0);
    });

    obs.observe(document.body, { childList: true });
  19. nielsAD revised this gist Jan 15, 2020. 1 changed file with 9 additions and 6 deletions.
    15 changes: 9 additions & 6 deletions marktplaats.user.js
    Original file line number Diff line number Diff line change
    @@ -3,13 +3,16 @@
    // @name marktplaats
    // @namespace nielsAD
    // @include *://www.marktplaats.nl/*
    // @version 1.0.3
    // @version 1.1.0
    // @grant none
    // @require https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js
    // ==/UserScript==

    $("article.search-result .seller-link").closest("article").remove();
    $("article.search-result .location-name:contains('Bezorgt in ')").closest("article").remove();
    $("article.search-result .location-name:contains('Heel Nederland')").closest("article").remove();
    $("div.listing-extension").remove();
    $("div.main-banners").remove();
    const obs = new MutationObserver(function() {
    $(".mp-Listings__admarktTitle").remove();
    $(".mp-Listing .mp-Listing-seller-link").closest("li").remove();
    $(".mp-Listing .mp-Listing-location:contains('Bezorgt in ')").closest("li").remove();
    $(".mp-Listing .mp-Listing-location:contains('Heel Nederland')").closest("li").remove();
    });

    obs.observe(document.getElementById('__next'), { childList: true, subtree: true });
  20. nielsAD revised this gist Jan 4, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion persgroep.user.js
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@
    // @namespace nielsAD
    // @include *://myprivacy.persgroep.net/*
    // @include *://myprivacy.dpgmedia.net/*
    // @version 1
    // @version 1.0.1
    // @grant none
    // ==/UserScript==

  21. nielsAD revised this gist Jan 4, 2020. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions persgroep.user.js
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,7 @@
    // @name persgroep
    // @namespace nielsAD
    // @include *://myprivacy.persgroep.net/*
    // @include *://myprivacy.dpgmedia.net/*
    // @version 1
    // @grant none
    // ==/UserScript==
  22. nielsAD revised this gist Jan 4, 2020. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion kudtcookiewet.user.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,9 @@
    // @name kudtkoekiewet
    // @namespace nielsAD
    // @include *://kudtkoekiewet.nl/*
    // @version 1
    // @include *://cookies.dumpert.nl/*
    // @include *://www.geenstijl.nl/*
    // @version 1.0.1
    // @grant none
    // ==/UserScript==

  23. nielsAD revised this gist Oct 19, 2019. 1 changed file with 9 additions and 2 deletions.
    11 changes: 9 additions & 2 deletions twitch.user.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    // @name twitch.tv
    // @namespace nielsAD
    // @include *://*.twitch.tv/*
    // @version 1.0.3
    // @version 1.1.0
    // @grant none
    // ==/UserScript==

    @@ -18,4 +18,11 @@ const fun = function() {
    const node = document.createElement('script');
    node.type = "text/javascript";
    node.textContent = '(' + fun.toString() + ')()';
    document.body.appendChild(node);
    document.body.appendChild(node);

    setInterval(function(){
    const bonus = document.getElementsByClassName("claimable-bonus__icon");
    for (let b of bonus) {
    b.click();
    }
    }, 5000);
  24. nielsAD revised this gist Sep 20, 2019. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions twitch.user.js
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,8 @@
    // @name twitch.tv
    // @namespace nielsAD
    // @include *://*.twitch.tv/*
    // @version 1.0.2
    // @version 1.0.3
    // @grant none
    // @run-at document-start
    // ==/UserScript==

    // Insert like this to work around greasemonkey jail
  25. nielsAD revised this gist Sep 20, 2019. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions twitch.user.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    // @name twitch.tv
    // @namespace nielsAD
    // @include *://*.twitch.tv/*
    // @version 1
    // @version 1.0.2
    // @grant none
    // @run-at document-start
    // ==/UserScript==
    @@ -16,7 +16,7 @@ const fun = function() {
    document.dispatchEvent(new Event('visibilitychange'));
    };

    const node = document.createElement ('script');
    const node = document.createElement('script');
    node.type = "text/javascript";
    node.textContent = '(' + fun.toString() + ')()';
    document.getElementsByTagName('head')[0].appendChild(node);
    document.body.appendChild(node);
  26. nielsAD revised this gist Sep 11, 2019. 1 changed file with 14 additions and 6 deletions.
    20 changes: 14 additions & 6 deletions twitch.user.js
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,22 @@
    // ==UserScript==
    // @description Disable Twitch automatically changing video quality when losing focus
    // @description Disable Twitch automatically changing video quality when playing in background
    // @name twitch.tv
    // @namespace nielsAD
    // @include *://*.twitch.tv/*
    // @version 1
    // @grant none
    // @run-at document-start
    // ==/UserScript==

    Object.defineProperty(document, 'hidden', {value: false, writable: false});
    Object.defineProperty(document, 'visibilityState', {value: 'visible', writable: false});
    Object.defineProperty(document, 'webkitVisibilityState', {value: 'visible', writable: false});
    document.dispatchEvent(new Event('visibilitychange'));
    document.hasFocus = function () { return true; };
    // Insert like this to work around greasemonkey jail
    const fun = function() {
    Object.defineProperty(document, 'hidden', {value: false, writable: false});
    Object.defineProperty(document, 'visibilityState', {value: 'visible', writable: false});
    Object.defineProperty(document, 'webkitVisibilityState', {value: 'visible', writable: false});
    document.dispatchEvent(new Event('visibilitychange'));
    };

    const node = document.createElement ('script');
    node.type = "text/javascript";
    node.textContent = '(' + fun.toString() + ')()';
    document.getElementsByTagName('head')[0].appendChild(node);
  27. nielsAD revised this gist Sep 11, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion persgroep.user.js
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    // ==UserScript==
    // @description Accept persgroep cookies
    // @name persgroep.net
    // @name persgroep
    // @namespace nielsAD
    // @include *://myprivacy.persgroep.net/*
    // @version 1
  28. nielsAD revised this gist Sep 11, 2019. 2 changed files with 1 addition and 15 deletions.
    3 changes: 1 addition & 2 deletions _userscripts.md
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,7 @@
    3. [kudtcookiewet](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/kudtcookiewet.user.js)
    4. [marktplaats](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/marktplaats.user.js)
    5. [nu.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/nu.nl.user.js)
    6. [persgroep.net](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    6. [persgroep](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    7. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    8. [volkskrant](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/volkskrant.user.js)
    9. [YouTube: Theater Mode](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/youtube.user.js)
    10. [YouTube: Age Verification Bypass](https://greasyfork.org/scripts/375525-youtube-age-verification-bypass/code/YouTube:%20Age%20Verification%20Bypass.user.js)
    13 changes: 0 additions & 13 deletions volkskrant.user.js
    Original file line number Diff line number Diff line change
    @@ -1,13 +0,0 @@
    // ==UserScript==
    // @description Accept Volkskrant cookies
    // @name volkskrant
    // @namespace nielsAD
    // @include *://www.volkskrant.nl/*
    // @version 2
    // @grant none
    // ==/UserScript==

    const ja = (document.getElementsByClassName("fjs-set-consent") || [])[0];
    if (ja && ja.innerText.indexOf("cookies") !== -1) {
    ja.click();
    }
  29. nielsAD revised this gist Sep 11, 2019. 5 changed files with 39 additions and 24 deletions.
    19 changes: 10 additions & 9 deletions _userscripts.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,10 @@
    1. [ad.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/algemeendagblad.user.js)
    2. [choice.npr](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/choice.npr.user.js)
    2. [ftm.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/followthemoney.user.js)
    3. [kudtcookiewet](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/kudtcookiewet.user.js)
    4. [marktplaats](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/marktplaats.user.js)
    5. [nu.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/nu.nl.user.js)
    6. [volkskrant](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/volkskrant.user.js)
    7. [YouTube: Theater Mode](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/youtube.user.js)
    8. [YouTube: Age Verification Bypass](https://greasyfork.org/scripts/375525-youtube-age-verification-bypass/code/YouTube:%20Age%20Verification%20Bypass.user.js)
    1. [choice.npr](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/choice.npr.user.js)
    2. [ftm.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/followthemoney.user.js)
    3. [kudtcookiewet](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/kudtcookiewet.user.js)
    4. [marktplaats](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/marktplaats.user.js)
    5. [nu.nl](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/nu.nl.user.js)
    6. [persgroep.net](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/persgroep.user.js)
    7. [twitch.tv](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/twitch.user.js)
    8. [volkskrant](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/volkskrant.user.js)
    9. [YouTube: Theater Mode](https://gist.github.com/nielsAD/d04568f2f240a9f0b225897e318bb2a9/raw/youtube.user.js)
    10. [YouTube: Age Verification Bypass](https://greasyfork.org/scripts/375525-youtube-age-verification-bypass/code/YouTube:%20Age%20Verification%20Bypass.user.js)
    13 changes: 0 additions & 13 deletions algemeendagblad.user.js
    Original file line number Diff line number Diff line change
    @@ -1,13 +0,0 @@
    // ==UserScript==
    // @description Accept AD cookies
    // @name ad.nl
    // @namespace nielsAD
    // @include *://www.ad.nl/*
    // @version 1
    // @grant none
    // ==/UserScript==

    const ja = (document.getElementsByClassName("fjs-accept") || [])[0];
    if (ja && ja.innerText.indexOf("cookies") !== -1) {
    ja.click();
    }
    13 changes: 13 additions & 0 deletions persgroep.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    // ==UserScript==
    // @description Accept persgroep cookies
    // @name persgroep.net
    // @namespace nielsAD
    // @include *://myprivacy.persgroep.net/*
    // @version 1
    // @grant none
    // ==/UserScript==

    const ja = (document.getElementsByClassName("fjs-set-consent") || [])[0];
    if (ja && ja.innerText.indexOf("cookies") !== -1) {
    ja.click();
    }
    14 changes: 14 additions & 0 deletions twitch.user.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    // ==UserScript==
    // @description Disable Twitch automatically changing video quality when losing focus
    // @name twitch.tv
    // @namespace nielsAD
    // @include *://*.twitch.tv/*
    // @version 1
    // @grant none
    // ==/UserScript==

    Object.defineProperty(document, 'hidden', {value: false, writable: false});
    Object.defineProperty(document, 'visibilityState', {value: 'visible', writable: false});
    Object.defineProperty(document, 'webkitVisibilityState', {value: 'visible', writable: false});
    document.dispatchEvent(new Event('visibilitychange'));
    document.hasFocus = function () { return true; };
    4 changes: 2 additions & 2 deletions volkskrant.user.js
    Original file line number Diff line number Diff line change
    @@ -3,11 +3,11 @@
    // @name volkskrant
    // @namespace nielsAD
    // @include *://www.volkskrant.nl/*
    // @version 1
    // @version 2
    // @grant none
    // ==/UserScript==

    const ja = (document.getElementsByClassName("button--accept") || [])[0];
    const ja = (document.getElementsByClassName("fjs-set-consent") || [])[0];
    if (ja && ja.innerText.indexOf("cookies") !== -1) {
    ja.click();
    }
  30. nielsAD revised this gist Apr 7, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion followthemoney.user.js
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    // @name followthemoney
    // @namespace nielsAD
    // @include *://www.ftm.nl/*
    // @version 1.0.0
    // @version 1
    // @grant none
    // @run-at document-idle
    // ==/UserScript==