Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  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();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement