// ==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 // @downloadURL none // ==/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); })();