Advertisement
Guest User

Untitled

a guest
Mar 17th, 2025
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // ==UserScript==
  2. // @name         AliExpress Redirect Script
  3. // @namespace    http://tampermonkey.net/
  4. // @version      1.0
  5. // @description  AliExpress Bundle deals Redirect
  6. // @author       Poseidon
  7. // @match        https://www.aliexpress.com/*
  8. // @grant        none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12.     'use strict';
  13.  
  14.     // Get current URL
  15.     const url = new URL(window.location.href);
  16.  
  17.     if (url.pathname.includes("/gcp/") || url.pathname.includes("/ssr/")) {
  18.         if (url.searchParams.has("productIds")){
  19.             // Get the value of productIds param
  20.             const productIds = url.searchParams.get("productIds");
  21.             // Split by colon and take the first ID
  22.             const productId = productIds.split(':')[0];
  23.  
  24.             // Create the new URL
  25.             const newUrl = `https://www.aliexpress.com/item/${productId}.html`;
  26.  
  27.             // Redirect to the new URL
  28.             window.location.replace(newUrl);
  29.         }
  30.     }
  31. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement