Greasy Fork by-site-searching URL autoextract

Automatically extract the domain name from an input URL.

K instalaci tototo skriptu si budete muset nainstalovat rozšíření jako Tampermonkey, Greasemonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Violentmonkey.

K instalaci tohoto skriptu si budete muset nainstalovat rozšíření jako Tampermonkey nebo Userscripts.

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

K instalaci tohoto skriptu si budete muset nainstalovat manažer uživatelských skriptů.

(Už mám manažer uživatelských skriptů, nechte mě ho nainstalovat!)

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.

(Už mám manažer uživatelských stylů, nechte mě ho nainstalovat!)

// ==UserScript==
// @name         Greasy Fork by-site-searching URL autoextract
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Automatically extract the domain name from an input URL.
// @author       shiquda
// @match        https://greasyfork.org/*/scripts/by-site
// @grant        none
// @license      MIT
// ==/UserScript==

(function() {
    'use strict';
    var tab = document.querySelector("body > div.width-constraint > section > form > input[type=search]:nth-child(2)")
    tab.addEventListener("input",change)
    function change(){
        var text = tab.value
        var change = text.match(/^https?:\/\/(?:www\.)?([^/?#]+)/i)[1]
        tab.value = change
    }
    // Your code here...
})();