Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name Auto-close tabs
- // @namespace kandelabr
- // @match https://*/*
- // @grant window.close
- // @version 1.1
- // @author -
- // @description Closes tabs automatically - set waste_of_bits below to hostnames you do not want to visit
- // ==/UserScript==
- let waste_of_bits = ['bing.com', 'rewards.bing.com']
- const sleep = async (milliseconds) => {
- await new Promise(resolve => {
- return setTimeout(resolve, milliseconds)
- });
- };
- var re = new RegExp(waste_of_bits.join('|'), "i");
- if (re.test(document.location.host)) {
- await sleep(300000);
- while(true) {
- window.close();
- await sleep(1000)
- }
- }
Add Comment
Please, Sign In to add comment