Advertisement
Guest User

Untitled

a guest
Jun 17th, 2015
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. // ==UserScript==
  2. // @name TagPro Fullscreen Button
  3. // @version 0.1
  4. // @include http://tagpro-*.koalabeast.com:*
  5. // @include http://tangent.jukejuice.com:*
  6. // @include http://*.newcompte.fr:*
  7. // @grant none
  8. // ==/UserScript==
  9.  
  10.  
  11. tagpro.ready(function() {
  12.  
  13. $('body').append('<button id="fullscreen1" onclick="actFullscreen()" style="position: absolute; left: 10px; top: 40px;">Fullscreen</button>');
  14.  
  15. $('#name').after('<button id="fullscreen1" onclick="actFullscreen()" style="margin-left: 50px;">Fullscreen</button>');
  16.  
  17. window.actFullscreen = function()
  18. {
  19. if (document.fullscreenElement || document.webkitFullscreenElement || document.mozFullScreenElement || document.msFullscreenElement)
  20. {
  21. var exitMethod = document.exitFullscreen || document.webkitExitFullscreen || document.mozCancelFullScreen || document.msExitFullscreen;
  22. if(exitMethod)
  23. exitMethod.call(document);
  24. }
  25. else
  26. {
  27. var bod = document.body,
  28. fullscreenMethod = bod.requestFullscreen || bod.webkitRequestFullscreen || bod.mozRequestFullScreen || bod.msRequestFullscreen;
  29. if(fullscreenMethod)
  30. fullscreenMethod.call(bod);
  31. }
  32. }
  33. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement