Kill popup window

Close all popup window automatic

As of 09.08.2020. See апошняя версія.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         Kill popup window
// @namespace    https://greasyfork.org/en/scripts/408032-close-all-popup-window/
// @version      0.3
// @description  Close all popup window automatic
// @author       TechComet
// @match        https://*/*
// @match        http://*/*
// @supportURL   https://greasyfork.org/en/scripts/408032-close-all-popup-window/feedback
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    var element_url = document.getElementsByTagName("a"), index_url;

    for (index_url = element_url.length - 1; index_url >= 0; index_url--) {
        var cur_url = element_url[index_url]

        cur_url.href = cur_url.href + "#no_close"

    }



    var except = [
        'google.com', 'facebook.com' //example except WebSites
    ]

    var hostname = window.location.hostname.replace("www.", "")

    if (except.indexOf("#no_close") == -1) {
        return;
    }
    if (except.indexOf(hostname) == -1) {
        window.close();
    }
    
})();