Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

short url script but for eBay & ETSY ?

About: Amazon short URL
edited November 2018 in Script Discussions IE

Hi! Congrats for this must-have script.
Are you able to create one for eBay & ETSY too ?

Only this workaround is available so far…

eBay copy short url button

All the best!


  • edited December 2018 Firefox

    Hi Freshhh,

    sorry for the delay. Just quickly made those for you, so they are not bulletproof. But should work. Let me know.

    Try this for Ebay:

    // ==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
    // @grant        none
    // @license      MIT
    // ==/UserScript==
    /* jshint esversion: 6 */
        '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));

    Try this for Etsy:

    // ==UserScript==
    // @name         Etsy short url
    // @namespace    graphen
    // @version      1.1.0
    // @description  Replaces long url by short url.
    // @author       graphen
    // @include*
    // @run-at       document-end
    // @icon
    // @grant        none
    // @license      MIT
    // ==/UserScript==
    /* jshint esversion: 6 */
        'use strict';
        var itemId = document.getElementById("listing-image").getAttribute("data-palette-listing-id");
        if(itemId) {
            history.replaceState(null, 'Shortened Etsy URL', "" + itemId);


  • Hi!

    Thanks a lot for giving it a try.
    I really appreciate it a lot because those long eBay url are very annoying.

    Unfortunately it does nothing.
    Tested with without luck, the link remains the same.

    Could you please test and try to fix it?

    And if it works please kindly add support for :




  • Bummer... Same for Etsy, it does nothing… weird
    I wonder how it can works for you and not for me?

  • I don't know.
    Works perfectly for me. Firefox 63.0.3, latest Tampermonkey, Windows 10.

    Modified ebay to support the three domains you mentioned.

  • edited December 2018 IE

    Fantastic, the new eBay short URL universal script works wonders!
    Thank you so much, this will definitely be a lifesaving script for all users.

    Just in case you don't mind adding all domains here is a full list:

    About the ETSY script there is a little bug, currently shortened URL are transformed like this:

    but it must be formatted like this:

    otherwise if you refresh the page there is a 404 not found error!

  • Thanks for the hints, both fixed.
    I put both scripts online now.


  • Tested and adopted. B)
    BIG THANKS ! !

Sign In or Register to comment.