Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 23rd, 2013  |  syntax: None  |  size: 1.18 KB  |  views: 39  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. var _ytmp3 = {
  2.   writeBtn : function(){
  3.     var clk = "window.open('http://www.youtube-mp3.org/redir?url='+encodeURIComponent(window.location))";
  4.     var obj = document.getElementById('watch7-secondary-actions');
  5.     if (obj) {
  6.       obj.innerHTML = obj.innerHTML +
  7.               '<button id="ytmp3Mp3Download" class="yt-uix-button yt-uix-tooltip" onclick="'+clk+'" type="button">'+
  8.               '<span class="yt-uix-button-content">Download mp3</span>'+
  9.               '</button>';
  10.     } else {
  11.         var obj = document.getElementById('watch-actions');
  12.         if (obj) {
  13.           obj.innerHTML = obj.innerHTML +
  14.                   '<button id="ytmp3Mp3Download" class="yt-uix-button yt-uix-tooltip" onclick="'+clk+'" type="button">'+
  15.                   '<span class="yt-uix-button-content">Download mp3</span>'+
  16.                   '</button>';
  17.         }
  18.     }
  19.   },
  20.  
  21.   checkForMissingBtn : function(){
  22.       if(!document.getElementById('ytmp3Mp3Download')) {
  23.         this.writeBtn();
  24.       }
  25.      
  26.       window.setTimeout(function(){this.checkForMissingBtn()}, 750);
  27.   },
  28.  
  29.   init : function(){
  30.     this.writeBtn();
  31.     this.checkForMissingBtn();
  32.   },
  33. };
  34.  
  35. _ytmp3.init();
clone this paste RAW Paste Data