您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the ?ref, ?click_key, and ?ga_order query parameters from the URL of an Etsy listing page and removes the ?ref=simple-shop-header query parameter and everything after it from the URL of an Etsy shop page
当前为
// ==UserScript== // @name Etsy URl Cleaner // @namespace https://greasyfork.org/en/scripts/456795-etsy-url-cleaner // @version 1.0.1 // @description Removes the ?ref, ?click_key, and ?ga_order query parameters from the URL of an Etsy listing page and removes the ?ref=simple-shop-header query parameter and everything after it from the URL of an Etsy shop page // @match https://www.etsy.com/listing/* // @match https://www.etsy.com/shop/* // @grant none // @icon https://www.etsy.com/favicon.ico // @license MIT // ==/UserScript== (function() { 'use strict'; // Get the current URL var url = window.location.href; // Check if the URL contains the ?ref, ?click_key, or ?ga_order parameter (for listing pages) or the ?ref=simple-shop-header parameter (for shop pages) if (url.indexOf('?ref') !== -1 || url.indexOf('?click_key') !== -1 || url.indexOf('?ga_order') !== -1 || url.indexOf('?ref=simple-shop-header') !== -1) { // Get the index of the ?ref, ?click_key, ?ga_order, or ?ref=simple-shop-header parameter that appears last in the URL var index = Math.max(url.indexOf('?ref'), url.indexOf('?click_key'), url.indexOf('?ga_order'), url.indexOf('?ref=simple-shop-header')); // Remove the ?ref, ?click_key, ?ga_order, or ?ref=simple-shop-header parameter and everything after it url = url.substring(0, index); // Update the URL without the ?ref, ?click_key, ?ga_order, or ?ref=simple-shop-header parameter window.history.pushState({}, '', url); } })();