115-rename-enhancer

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

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey 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.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

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         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]);
        },
    });
})();