您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Remove params from share url copied
当前为
// ==UserScript== // @name Reddit remove params from share url // @namespace https://gf.zukizuki.org/users/821661 // @match https://*.reddit.com/* // @grant none // @run-at document-start // @version 1.0 // @author hdyzen // @description Remove params from share url copied // @license GPL-3.0 // ==/UserScript== 'use strict'; // Params to delete in url copied const paramsToDelete = ['utm_source', 'utm_medium']; // Patch select const originalSelect = HTMLTextAreaElement.prototype.select; HTMLTextAreaElement.prototype.select = function () { const url = this.value; // Value in textarea to copy const params = new URL(url); // Url paramsToDelete.forEach(param => params.searchParams.delete(param)); // Delete params this.value = params.href; // Value modded return originalSelect.apply(this, arguments); };