eh-change-title

修改eh搜索页的标题,方便收藏网站

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Greasemonkey lub Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana jest instalacje jednego z następujących rozszerzeń: Tampermonkey, Violentmonkey.

Aby zainstalować ten skrypt, wymagana będzie instalacja rozszerzenia Tampermonkey lub Userscripts.

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

Aby zainstalować ten skrypt, musisz zainstalować rozszerzenie menedżera skryptów użytkownika.

(Mam już menedżera skryptów użytkownika, pozwól mi to zainstalować!)

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.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Będziesz musiał zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

Musisz zainstalować rozszerzenie menedżera stylów użytkownika, aby zainstalować ten styl.

(Mam już menedżera stylów użytkownika, pozwól mi to zainstalować!)

// ==UserScript==
// @name         eh-change-title
// @namespace    http://tampermonkey.net/
// @version      0.2.1
// @description  修改eh搜索页的标题,方便收藏网站
// @author       Y_jun
// @match        *://*.exhentai.org/*f_search=*
// @match        *://*.e-hentai.org/*f_search=*
// @license      MIT
// @icon         https://em-content.zobj.net/source/skype/289/black-nib_2712-fe0f.png
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...

    function GetQueryString(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
        var r = window.location.search.substr(1).match(reg); //获取url中"?"符后的字符串并正则匹配
        var context = "";
        if (r != null) {
            context = decodeURIComponent(r[2]);
        }
        reg = null;
        r = null;
        return context == null || context == "" || context == "undefined" ? "" : context;
    }

    // document.title = decodeURIComponent(window.location.href).slice(window.location.href.indexOf('=') + 1);
    var newTitle = decodeURIComponent(GetQueryString("f_search"));
    if (newTitle != null) {
        document.title = newTitle;
    }
})();