// ==UserScript== // @name Download MP3 & Video for YouTube v2.2 - (HD, MP4, AVI, FLV, Others) // @description This script helps to add a YouTube download button. // @namespace https://greasyfork.org/ // @homepageURL https://greasyfork.org/scripts/34613 // @supportURL https://greasyfork.org/scripts/34613/feedback // @author Punisher // @version 2.2 // @date 2018-02-03 // @compatible chrome // @compatible firefox // @compatible opera // @compatible safari // @license GNU GPL v3.0 or later. http://www.gnu.org/copyleft/gpl.html // @match *://www.youtube.com/* // @downloadURL none // ==/UserScript== if(document.getElementById("polymer-app") || document.getElementById("masthead") || window.Polymer){ setInterval(function(){ if(window.location.href.indexOf("watch?v=") < 0){ return false; } if(document.getElementById("count") && document.getElementById("genyoutube") === null){ polymerInject(); } }, 100); } else { setInterval(function(){ if(window.location.href.indexOf("watch?v=") < 0){ return false; } if(document.getElementById("watch7-subscription-container") && document.getElementById("genyoutube") === null){ htmlInject(); } }, 100); } function htmlInject(){ if (document.getElementById("watch7-subscription-container")) { var wrap = document.getElementById('watch7-subscription-container'); var button = "