Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var _ytmp3 = {
- writeBtn : function(){
- var clk = "window.open('http://www.youtube-mp3.org/redir?url='+encodeURIComponent(window.location))";
- var obj = document.getElementById('watch7-secondary-actions');
- if (obj) {
- obj.innerHTML = obj.innerHTML +
- '<button id="ytmp3Mp3Download" class="yt-uix-button yt-uix-tooltip" onclick="'+clk+'" type="button">'+
- '<span class="yt-uix-button-content">Download mp3</span>'+
- '</button>';
- } else {
- var obj = document.getElementById('watch-actions');
- if (obj) {
- obj.innerHTML = obj.innerHTML +
- '<button id="ytmp3Mp3Download" class="yt-uix-button yt-uix-tooltip" onclick="'+clk+'" type="button">'+
- '<span class="yt-uix-button-content">Download mp3</span>'+
- '</button>';
- }
- }
- },
- checkForMissingBtn : function(){
- if(!document.getElementById('ytmp3Mp3Download')) {
- this.writeBtn();
- }
- window.setTimeout(function(){this.checkForMissingBtn()}, 750);
- },
- init : function(){
- this.writeBtn();
- this.checkForMissingBtn();
- },
- };
- _ytmp3.init();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement