AliExpress bypass "3 Picks"

Redirects AliExpress "gcp" URLs to the corresponding item page using productIds.

// ==UserScript==
// @name         AliExpress bypass "3 Picks"
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Redirects AliExpress "gcp" URLs to the corresponding item page using productIds.
// @author       You
// @match        *://www.aliexpress.com/gcp*
// @grant        none
// @license MIT
// ==/UserScript==

(function() {
    'use strict';

    // Check if the current URL matches the gcp pattern
    const currentUrl = new URL(window.location.href);

    // Check if the URL starts with "https://www.aliexpress.com/gcp"
    if (currentUrl.href.startsWith('https://www.aliexpress.com/gcp')) {
        // Get the productIds parameter
        const productIds = currentUrl.searchParams.get('productIds');

        // If productIds exists, redirect to the item page
        if (productIds) {
            const newUrl = `https://www.aliexpress.com/item/${productIds}.html`;
            // Navigate to the new URL
            window.location.replace(newUrl);
        }
    }
})();