Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name AliExpress Redirect Script
- // @namespace http://tampermonkey.net/
- // @version 1.0
- // @description AliExpress Bundle deals Redirect
- // @author Poseidon
- // @match https://www.aliexpress.com/*
- // @grant none
- // ==/UserScript==
- (function() {
- 'use strict';
- // Get current URL
- const url = new URL(window.location.href);
- if (url.pathname.includes("/gcp/") || url.pathname.includes("/ssr/")) {
- if (url.searchParams.has("productIds")){
- // Get the value of productIds param
- const productIds = url.searchParams.get("productIds");
- // Split by colon and take the first ID
- const productId = productIds.split(':')[0];
- // Create the new URL
- const newUrl = `https://www.aliexpress.com/item/${productId}.html`;
- // Redirect to the new URL
- window.location.replace(newUrl);
- }
- }
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement