Skip to content

Instantly share code, notes, and snippets.

@Oisann
Last active October 18, 2022 20:50
Show Gist options
  • Save Oisann/eaa7b76592e62c5f40997809d653c20a to your computer and use it in GitHub Desktop.
Save Oisann/eaa7b76592e62c5f40997809d653c20a to your computer and use it in GitHub Desktop.

Revisions

  1. Oisann revised this gist Oct 18, 2022. 1 changed file with 12 additions and 12 deletions.
    24 changes: 12 additions & 12 deletions no-youtube-ambilight.user.js
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,7 @@
    // ==UserScript==
    // @name No YT Ambilight
    // @namespace https://oisann.net/
    // @version 0.1
    // @version 0.3
    // @description Remove YouTube Cinematics Effect.
    // @author Oisann
    // @match https://www.youtube.com/watch*
    @@ -11,16 +11,16 @@

    (function() {
    'use strict';
    function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css.replace(/;/g, ' !important;');
    head.appendChild(style);
    const attribute = "style";
    const style = "display: none";
    function removeAmbilight() {
    const element = document.getElementById('cinematics');
    if (element) {
    if (element.getAttribute(attribute) !== style) {
    element.setAttribute(attribute, style);
    }
    }
    window.requestAnimationFrame(removeAmbilight);
    }
    window.addEventListener("load", function() {
    addGlobalStyle("#cinematics { display: none }");
    }, false);
    window.requestAnimationFrame(removeAmbilight);
    })();
  2. Oisann revised this gist Oct 18, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion no-youtube-ambilight.user.js
    Original file line number Diff line number Diff line change
    @@ -21,6 +21,6 @@
    head.appendChild(style);
    }
    window.addEventListener("load", function() {
    addGlobalStyle("div#cinematics { display: none }");
    addGlobalStyle("#cinematics { display: none }");
    }, false);
    })();
  3. Oisann revised this gist Oct 18, 2022. No changes.
  4. Oisann renamed this gist Oct 18, 2022. 1 changed file with 0 additions and 0 deletions.
  5. Oisann created this gist Oct 18, 2022.
    26 changes: 26 additions & 0 deletions no-youtube-ambilight.userscript.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,26 @@
    // ==UserScript==
    // @name No YT Ambilight
    // @namespace https://oisann.net/
    // @version 0.1
    // @description Remove YouTube Cinematics Effect.
    // @author Oisann
    // @match https://www.youtube.com/watch*
    // @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
    // @grant none
    // ==/UserScript==

    (function() {
    'use strict';
    function addGlobalStyle(css) {
    var head, style;
    head = document.getElementsByTagName('head')[0];
    if (!head) { return; }
    style = document.createElement('style');
    style.type = 'text/css';
    style.innerHTML = css.replace(/;/g, ' !important;');
    head.appendChild(style);
    }
    window.addEventListener("load", function() {
    addGlobalStyle("div#cinematics { display: none }");
    }, false);
    })();