Remove controlslist=nodownload

Removes the attribute controlslist=nodownload of video tag.

< Rückmeldungen auf Remove controlslist=nodownload

Frage/Kommentar

§
Veröffentlicht: 23.07.2023

Maybe you can consider doing that for <audio> too. Certainly I have done that myself.

§
Veröffentlicht: 23.07.2023
Bearbeitet: 23.07.2023

Consider this:

// ==UserScript==
// @name        Remove controlslist=nodownload
// @namespace   remove-controlslist-nodownload
// @version     8
// @description Removes the attribute controlslist=nodownload of video and audio tag.
// @author      Shawphy
// @grant       none
// @match       *://*/*
// ==/UserScript==

(function() {
    var target = document.querySelector('body');
    var observer = new MutationObserver(function(mutations) {
        mutations.forEach(function(mutation) {
            Array.prototype.forEach.call(document.querySelectorAll('video[controlslist~=nodownload], audio[controlslist~=nodownload]'), function(el){
                el.controlsList.remove("nodownload");
            });
        });
    });

    var config = { childList: true, subtree: true }
    observer.observe(target, config);
})();

Antwort schreiben

Anmelden um eine Antwort zu senden.