Skip to content

Instantly share code, notes, and snippets.

@Duckle29
Created October 17, 2018 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Duckle29/62c3efe13613141f33089881a465b127 to your computer and use it in GitHub Desktop.
Save Duckle29/62c3efe13613141f33089881a465b127 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @run-at document-start
// @id Aliexpress URL Cleaner
// @name Aliexpress URL Cleaner
// @namespace
// @description Clean aliexpress item URL
// @include http://www.aliexpress.com/item/*
// @include https://www.aliexpress.com/item/*
// @include http://www.aliexpress.com/store/product/*
// @include https://www.aliexpress.com/store/product/*
// @version 1.1
// ==/UserScript==
(function() {
'use strict';
var p1 = document.URL.match(/https?:\/\/(|www).aliexpress.com\/(?:item|store\/product)\//g);
var p2 = document.URL.match(/\/[0-9_]+[.]html(?=$|[?])/g);
if (p1 && p2 && p1+p2 != document.URL) history.replaceState(null, '', p1+p2);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment