Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Close All Tabs on Domain
- // @version 0.1
- // @description Close all tabs on current domain - userscript
- // @match http://*/*
- // @match https://*/*
- // ==/UserScript==
- function chls4c(){
- if(new Date().getTime() - localStorage.getItem('lsc2ls3') < 2000 && new Date().getTime() - localStorage.getItem('lsc2ls3') > 0 ){
- var o=document.createElement('a');
- o.href='javascript: window.close();';
- document.getElementsByTagName('body')[0].appendChild(o);
- o.click();
- window.close();
- open(location, '_self').close();
- }
- }
- setInterval(chls4c, 1000);
- /*
- This is .user.js part of the script. It's provides the way to use a bookmarklet to close all tabs on domain. The bookmarklet is
- ____________________________________________
- javascript:var o=document.createElement('a');o.href='javascript: localStorage.setItem("lsc2ls3", new Date().getTime());';document.getElementsByTagName('body')[0].appendChild(o); o.click();
- _______________________________________________
- */
Advertisement
Add Comment
Please, Sign In to add comment