115-rename-enhancer

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

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

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.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

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