Created
October 17, 2018 22:07
-
-
Save Duckle29/62c3efe13613141f33089881a465b127 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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