115-rename-enhancer

優化115網盤文件重命名邏輯,支持修改後綴名。

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

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

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         115-rename-enhancer
// @name:zh-CN   115重命名增强
// @name:zh-HK   115重命名增強
// @name:zh-TW   115重命名增強
// @version      0.1.1
// @author       kunki
// @description  優化115網盤文件重命名邏輯,支持修改後綴名。
// @description:zh-CN  優化115網盤文件重命名邏輯,支持修改後綴名。
// @description:zh-HK  優化115網盤文件重命名邏輯,支持修改後綴名。
// @description:zh-TW  優化115網盤文件重命名邏輯,支持修改後綴名。
// @match        https://115.com/*
// @exclude      https://115.com/s/*
// @icon         https://115.com/favicon.ico
// @grant        none
// @license      GPL-3.0 License
// @run-at       document-end
// @namespace    https://greasyfork.org/scripts/447226
// @supportURL   https://gist.github.com/kunki/afc4e69df868266f3eb0ed02fcf0546a
// @homepageURL  https://gist.github.com/kunki/afc4e69df868266f3eb0ed02fcf0546a
// ==/UserScript==

(function() {
    let _indexOf = String.prototype.indexOf;
    Object.defineProperty(String.prototype, 'indexOf', {
        configurable: true,
        writable: true,
        value: function(search, start) {
            try {
                let me = String.prototype.indexOf;
                // caller is forbidden in strict mode, so try and catch exception simply.
                if (me.caller !== me) {
                    if (me.caller.toString().indexOf('cache.suffix') != -1) {
                        return -1;
                    }
                }
            } catch (e) {}
            return _indexOf.apply(this, [search, start]);
        },
    });
})();