Greasy Fork is available in English.
Show the shortest possible URL for Ebay items.
< Feedback on Ebay URL Cleaner/ shorter
This version fixes the endless reload loop when selecting item specifics:
// ==UserScript== // @name Ebay URL Cleaner/ shorter // @description Show the shortest possible URL for Ebay items. // @namespace https://arantius.com/misc/greasemonkey/ // @match https://www.ebay.com/itm/* // @run-at document-start // @version 1.1 // @grant none // @icon https://pages.ebay.com/favicon.ico // ==/UserScript== function getProductId() { var m; m = document.location.href.match(/(?:.+\/)?itm\/([^/?]+)/); if (m) return m[1]; } function getVariant() { var m; m = document.location.search.match(/var=\d+/); if (m) return '?' + m[0]; else return ''; } var productId = getProductId(); if (productId) { var url = 'https://www.ebay.com/itm/' + productId + getVariant(); if (location.href != url) { history.replaceState({}, document.title, url); } }
Sign in to post a reply.
This version fixes the endless reload loop when selecting item specifics: