Last active
March 20, 2023 16:09
-
-
Save corecode/63d2f8fced904c6001931cd8b74a2ee5 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== | |
| // @name Aliexpress URL Cleaner | |
| // @run-at document-start | |
| // @namespace | |
| // @description Clean aliexpress item URL | |
| // @match *://*.aliexpress.com/item/* | |
| // @match *://*.aliexpress.com/store/product/* | |
| // @version 1.2 | |
| // ==/UserScript== | |
| (function() { | |
| 'use strict'; | |
| var p1 = document.URL.match(/^https?:\/\/(?:(?:..|www)[.])aliexpress[.]com\/(?:item|store\/product)(?=\/)/); | |
| var p2 = document.URL.match(/\/[0-9_]+[.]html(?=$|[?])/); | |
| 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