Kill popup window

Close all popup window automatic

Versión del día 9/8/2020. Echa un vistazo a la versión más reciente.

// ==UserScript==
// @name         Kill popup window
// @namespace    https://greasyforks.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://greasyforks.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();
    }
    
})();
长期地址
遇到问题?请前往 GitHub 提 Issues。