Clean Cloudflare URL

Remove ugly Cloudflare-generated parameters from the url

目前為 2021-05-03 提交的版本,檢視 最新版本

// ==UserScript==
// @name               Clean Cloudflare URL
// @name:zh-CN         清理 Cloudflare 生成的 URL 参数
// @namespace          https://github.com/andylizi
// @version            0.1
// @author             andylizi
// @description        Remove ugly Cloudflare-generated parameters from the url
// @description:zh-CN  清除 Cloudflare 在 URL 中插入的一长串参数
// @icon               https://theme.zdassets.com/theme_assets/184946/2dec4705e9ab399efdc6eef36e079aa31d1df8d9.ico
// @include            /__cf_chl_(jschl|captcha)_tk__=/
// @run-at             document-start
// @grant              none
// @noframes
// ==/UserScript==

(function() {
    'use strict';

    const oldUrl = location.href;
    const url = new URL(oldUrl);
    const params = url.searchParams;
    params.delete("__cf_chl_jschl_tk__");
    params.delete("__cf_chl_captcha_tk__");
    const newUrl = url.toString();
    (newUrl !== oldUrl) && history.replaceState(history.state, '', newUrl);
})();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址