Greasemonkey script to trick sites to think they are focused (like clixsense)


SUBMITTED BY: KapguHaJI

DATE: May 29, 2017, 5:22 a.m.

FORMAT: JavaScript

SIZE: 638 Bytes

HITS: 129706

  1. // ==UserScript==
  2. // @name ForceTabFocus
  3. // @namespace ForceTabFocus
  4. // @version 1.0
  5. // @date 2014-04-22
  6. // @author Cardinal
  7. // @grant none
  8. // @include http://www.clixsense.com/*
  9. // ==/UserScript==
  10. (function(w){
  11. function _focus(){
  12. var _t=document.createElement('script');_t.setAttribute("type","text/javascript");
  13. _t.text="document.__proto__.hasFocus=function(){return (true);};"; document.getElementsByTagName("head")[0].appendChild(_t);
  14. w.onbeforeunload=null;
  15. }
  16. if(document.addEventListener)
  17. document.addEventListener('DOMContentLoaded', _focus, false);
  18. })(window);

comments powered by Disqus