Remove controlslist=nodownload

Removes the attribute controlslist=nodownload of video tag.

< Feedback on Remove controlslist=nodownload

Question/comment

§
Posted: 2023-07-23

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

§
Posted: 2023-07-23
Edited: 2023-07-23

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);
})();

Post reply

Sign in to post a reply.