您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Replaces long url by short url.
当前为
// ==UserScript== // @name eBay short URL // @namespace graphen // @version 1.2.0 // @description Replaces long url by short url. // @author Ariel Jannai, graphen // @include /^https:\/\/www\.(be(fr|nl)\.)?ebay\.(at|ca|cn|vn|ie|it|nl|ph|pl|es|ch|de|fr|be|co\.(uk|th)|com(\.(au|hk|my|sg|tw))?)\/itm\/.*/ // @run-at document-end // @icon https://cdn4.iconfinder.com/data/icons/flat-brand-logo-2/512/ebay-128.png // @grant none // @license MIT // ==/UserScript== /* jshint esversion: 6 */ (function(){ 'use strict'; function tryShortUrl(url) { var urlPattern = /(be(fr|nl)\.)?ebay\.(at|ca|cn|vn|ie|it|nl|ph|pl|es|ch|de|fr|be|co\.(uk|th)|com(\.(au|hk|my|sg|tw))?)\/itm\//; if(urlPattern.test(url)) { var itmId = url.match(/\/(\d{12})(\?|$)/)[1]; return 'https://www.' + urlPattern.exec(url)[0] + itmId; } else { return url; } } var url = String(window.location.href); history.replaceState(null, 'Shortened Ebay URL', tryShortUrl(url)); })();