YouTube - Disable Inline Playback ("Keep hovering to play")

Disable the Inline Playback feature ("keep hovering to play") on YouTube even when logged out

2022-09-10 يوللانغان نەشرى. ئەڭ يېڭى نەشرىنى كۆرۈش.

// ==UserScript==
// @name         YouTube - Disable Inline Playback ("Keep hovering to play")
// @namespace    Violentmonkey Scripts
// @match        *://www.youtube.com/*
// @version      2.1
// @author       jez9999
// @description  Disable the Inline Playback feature ("keep hovering to play") on YouTube even when logged out
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
 
    // ********************
    // Reminder: set the following in Violentmonkey advanced settings for Editor:
    // "tabSize": 4,
    // "indentUnit": 4,
    // "autoCloseBrackets": false,
    //
    // Also, bear in mind there appears to be a bug in Violentmonkey where after a while, MutationObserver's
    // stop being debuggable and the whole browser needs restarting before it'll work again.
    // ********************

    var sheet = document.createElement('style')
    sheet.innerHTML = ".ytd-thumbnail-overlay-loading-preview-renderer {display: none!important;} .ytp-inline-preview-ui {display: none!important;} #preview {display: none!important;}";
    document.body.appendChild(sheet);
})();