您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Removes the ?ref, ?click_key, ?ga_order, and ?external 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.3
- // @description Removes the ?ref, ?click_key, ?ga_order, and ?external 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/*
- // @match https://i.etsystatic.com/*
- // @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);
- }
- // Check if the URL already contains "/il_fullxfull"
- if (url.indexOf('/il_fullxfull') !== -1) {
- return;
- }
- // Check if the URL contains "/il_"
- if (url.indexOf('/il_') !== -1) {
- // Get the index of the first dot after "/il_"
- var dotIndex = url.indexOf('.', url.indexOf('/il_'));
- // Replace the content between "/il_" and the first dot after it with "fullxfull"
- url = url.substring(0, url.indexOf('/il_')) + '/il_fullxfull' + url.substring(dotIndex);
- // Update the URL with the modified URL
- window.location.href = url;
- }
- })();