Скрипты на JavaScript для Алиэкспресс

Тема закреплена бессрочно

Пользуетесь ли этими скриптами?

  • Да

    Голосов: 290 64,4%
  • Нет

    Голосов: 160 35,6%

  • Всего проголосовало
    450
Внимание, скрипт разверки стал палится, после него акки детерменируются, я так 7 акков убил, пока не отключил скрипт и не нашел "свежий номер'",он остался в живых.
Что за скрипт? Поиском не нашел - можно ссылку?
 
почему рандомайзер адреса тупит у всех? до этого работал нормально. обнова какая?
 
кто может подсказать, залил все данные в скрипт по доведению оплаты по webmoney, но он не вставляет логин-пасс. Только нажимает оплату.
 
Есть такая фигня. Недавно поломался. Раньше всё было нормально. Наверное только автор сможет подкорректировать.
 
Новый скрипт. Скрипт переключает страну, валюта всегда одна.
1612114112157.png

JavaScript:
// ==UserScript==
// @name         Aliexpress RU-KZ country Changer
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Изменяет страну на Алиэкспресс
// @author       Andronio
// @include      https://*aliexpress.ru/*
// @include      https://*aliexpress.com/*
// @grant        none
// @run-at       document-end
// ==/UserScript==
(function repeat() {
    'use strict';

let myCountry = ["KZ","RU","US"];
let myCurrency = "USD";

    let logoPic = document.querySelector(".hm-left");
    if (!logoPic) return setTimeout(repeat, 200);
    logoPic.innerHTML = "";
    myCountry.forEach( el => {
        logoPic.innerHTML += `<div class="currency-button change-country" data-curr="${el}"><span class="css_flag css_${el.toLowerCase()}" style="display:inline"></span><span class="shipping-text" style="display:inline">${el}</span></div>`;
    });
    logoPic.innerHTML += `<a class="my-ali-logo" href="//${location.host}"><span class="my-ali-logo-orange">Ali</span><span class="my-ali-logo-red">Express</span></a>`;
    let aliLink = document.createElement("a");

    let style = document.createElement("style");
    style.innerHTML = `.currency-button {
                            display: inline-block;
                            padding: 5px 10px;
                            margin: 20px 0 0 20px;
                            border: 2px solid black;
                            border-radius: 0.5em;
                            cursor:pointer;
                        }

                        .no-modify-btn {background-color: OrangeRed;}

                        .yes-modify-btn {background-color: Lime;}
                        .my-ali-logo {
                            display:block;
                            font-size: 14px;
                            margin: 10px 0 0 20px;
                        }
                        .my-ali-logo-orange {color: Orange;}
                        .my-ali-logo-red {color: Red;}
                     `;
    document.head.append(style);
    logoPic.addEventListener("click", btnClickHandler);

    function btnClickHandler(event) {
        let btn = event.target.closest(".change-country");
        if (!btn) return;
        let country = btn.dataset.curr;
        let cookies = document.cookie.split('; ');
        let isNeedModif = false;
        let isFound = false;
        let str;
        for (let i = 0; i < cookies.length; i++) {
            if (cookies[i].startsWith("aep_usuc_f=")) { // Если нашел нужную куку
                let cookie = cookies[i].slice(11).split('&'); // Убираем aep_usuc_f= и разделяем
                cookie = cookie.map(elem => { // Смотрим, что в куке
                    if (elem.startsWith("c_tp=")) {
                        isFound = true;
                        if (elem.slice(5) == myCurrency)
                            return elem;
                        else {
                            isNeedModif = true;
                            return "c_tp=" + myCurrency;
                        }
                    } else if (elem.startsWith("region=")) {
                        isFound = true;
                        let currCountry = elem.slice(7);
                        if (country == "")
                            return elem;
                        else if (currCountry == country)
                            return elem
                        else {
                            isNeedModif = true;
                            return "region=" + country;
                        }

                    } else return elem;
                });
                if (!isFound) {
                    cookie.push("c_tp=" + myCurrency);
                    if (myCountry != "") cookie.push("region=" + country);
                }
                str = cookie.join("&");
                break;
            }
        }
        if (isNeedModif || !isFound) {
            if (window.location.hostname.includes("aliexpress.ru")) {
                document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2088 03:14:07 GMT; domain=.aliexpress.ru`;
                window.location.reload();
            } else if (window.location.hostname.includes("aliexpress.com")) {
                document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2088 03:14:07 GMT; domain=.aliexpress.com`;
                window.location.reload();
            } else {alert("Ошибка в скрипте")};
            btn.classList.add("yes-modify-btn");
            setTimeout(() => {btn.classList.remove("yes-modify-btn");}, 300);
            window.location.reload();
        } else {
            btn.classList.add("no-modify-btn");
            setTimeout(() => {btn.classList.remove("no-modify-btn");}, 300);
        }
    }

})();
 
Новый скрипт. Скрипт переключает страну, валюта всегда одна.
Посмотреть вложение 247609
JavaScript:
// ==UserScript==
// @name         Aliexpress RU-KZ country Changer
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Изменяет страну на Алиэкспресс
// @author       Andronio
// @include      https://*aliexpress.ru/*
// @include      https://*aliexpress.com/*
// @grant        none
// @run-at       document-end
// ==/UserScript==
(function repeat() {
    'use strict';

let myCountry = ["KZ","RU","US"];
let myCurrency = "USD";

    let logoPic = document.querySelector(".hm-left");
    if (!logoPic) return setTimeout(repeat, 200);
    logoPic.innerHTML = "";
    myCountry.forEach( el => {
        logoPic.innerHTML += `<div class="currency-button change-country" data-curr="${el}"><span class="css_flag css_${el.toLowerCase()}" style="display:inline"></span><span class="shipping-text" style="display:inline">${el}</span></div>`;
    });
    logoPic.innerHTML += `<a class="my-ali-logo" href="//${location.host}"><span class="my-ali-logo-orange">Ali</span><span class="my-ali-logo-red">Express</span></a>`;
    let aliLink = document.createElement("a");

    let style = document.createElement("style");
    style.innerHTML = `.currency-button {
                            display: inline-block;
                            padding: 5px 10px;
                            margin: 20px 0 0 20px;
                            border: 2px solid black;
                            border-radius: 0.5em;
                            cursor:pointer;
                        }

                        .no-modify-btn {background-color: OrangeRed;}

                        .yes-modify-btn {background-color: Lime;}
                        .my-ali-logo {
                            display:block;
                            font-size: 14px;
                            margin: 10px 0 0 20px;
                        }
                        .my-ali-logo-orange {color: Orange;}
                        .my-ali-logo-red {color: Red;}
                     `;
    document.head.append(style);
    logoPic.addEventListener("click", btnClickHandler);

    function btnClickHandler(event) {
        let btn = event.target.closest(".change-country");
        if (!btn) return;
        let country = btn.dataset.curr;
        let cookies = document.cookie.split('; ');
        let isNeedModif = false;
        let isFound = false;
        let str;
        for (let i = 0; i < cookies.length; i++) {
            if (cookies[i].startsWith("aep_usuc_f=")) { // Если нашел нужную куку
                let cookie = cookies[i].slice(11).split('&'); // Убираем aep_usuc_f= и разделяем
                cookie = cookie.map(elem => { // Смотрим, что в куке
                    if (elem.startsWith("c_tp=")) {
                        isFound = true;
                        if (elem.slice(5) == myCurrency)
                            return elem;
                        else {
                            isNeedModif = true;
                            return "c_tp=" + myCurrency;
                        }
                    } else if (elem.startsWith("region=")) {
                        isFound = true;
                        let currCountry = elem.slice(7);
                        if (country == "")
                            return elem;
                        else if (currCountry == country)
                            return elem
                        else {
                            isNeedModif = true;
                            return "region=" + country;
                        }

                    } else return elem;
                });
                if (!isFound) {
                    cookie.push("c_tp=" + myCurrency);
                    if (myCountry != "") cookie.push("region=" + country);
                }
                str = cookie.join("&");
                break;
            }
        }
        if (isNeedModif || !isFound) {
            if (window.location.hostname.includes("aliexpress.ru")) {
                document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2088 03:14:07 GMT; domain=.aliexpress.ru`;
                window.location.reload();
            } else if (window.location.hostname.includes("aliexpress.com")) {
                document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2088 03:14:07 GMT; domain=.aliexpress.com`;
                window.location.reload();
            } else {alert("Ошибка в скрипте")};
            btn.classList.add("yes-modify-btn");
            setTimeout(() => {btn.classList.remove("yes-modify-btn");}, 300);
            window.location.reload();
        } else {
            btn.classList.add("no-modify-btn");
            setTimeout(() => {btn.classList.remove("no-modify-btn");}, 300);
        }
    }

})();
казахи даже есть. а Украины нет(
 
Новый скрипт. Скрипт переключает страну, валюта всегда одна.
Посмотреть вложение 247609
JavaScript:
// ==UserScript==
// @name         Aliexpress RU-KZ country Changer
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Изменяет страну на Алиэкспресс
// @author       Andronio
// @include      https://*aliexpress.ru/*
// @include      https://*aliexpress.com/*
// @grant        none
// @run-at       document-end
// ==/UserScript==
(function repeat() {
    'use strict';

let myCountry = ["KZ","RU","US"];
let myCurrency = "USD";

    let logoPic = document.querySelector(".hm-left");
    if (!logoPic) return setTimeout(repeat, 200);
    logoPic.innerHTML = "";
    myCountry.forEach( el => {
        logoPic.innerHTML += `<div class="currency-button change-country" data-curr="${el}"><span class="css_flag css_${el.toLowerCase()}" style="display:inline"></span><span class="shipping-text" style="display:inline">${el}</span></div>`;
    });
    logoPic.innerHTML += `<a class="my-ali-logo" href="//${location.host}"><span class="my-ali-logo-orange">Ali</span><span class="my-ali-logo-red">Express</span></a>`;
    let aliLink = document.createElement("a");

    let style = document.createElement("style");
    style.innerHTML = `.currency-button {
                            display: inline-block;
                            padding: 5px 10px;
                            margin: 20px 0 0 20px;
                            border: 2px solid black;
                            border-radius: 0.5em;
                            cursor:pointer;
                        }

                        .no-modify-btn {background-color: OrangeRed;}

                        .yes-modify-btn {background-color: Lime;}
                        .my-ali-logo {
                            display:block;
                            font-size: 14px;
                            margin: 10px 0 0 20px;
                        }
                        .my-ali-logo-orange {color: Orange;}
                        .my-ali-logo-red {color: Red;}
                     `;
    document.head.append(style);
    logoPic.addEventListener("click", btnClickHandler);

    function btnClickHandler(event) {
        let btn = event.target.closest(".change-country");
        if (!btn) return;
        let country = btn.dataset.curr;
        let cookies = document.cookie.split('; ');
        let isNeedModif = false;
        let isFound = false;
        let str;
        for (let i = 0; i < cookies.length; i++) {
            if (cookies[i].startsWith("aep_usuc_f=")) { // Если нашел нужную куку
                let cookie = cookies[i].slice(11).split('&'); // Убираем aep_usuc_f= и разделяем
                cookie = cookie.map(elem => { // Смотрим, что в куке
                    if (elem.startsWith("c_tp=")) {
                        isFound = true;
                        if (elem.slice(5) == myCurrency)
                            return elem;
                        else {
                            isNeedModif = true;
                            return "c_tp=" + myCurrency;
                        }
                    } else if (elem.startsWith("region=")) {
                        isFound = true;
                        let currCountry = elem.slice(7);
                        if (country == "")
                            return elem;
                        else if (currCountry == country)
                            return elem
                        else {
                            isNeedModif = true;
                            return "region=" + country;
                        }

                    } else return elem;
                });
                if (!isFound) {
                    cookie.push("c_tp=" + myCurrency);
                    if (myCountry != "") cookie.push("region=" + country);
                }
                str = cookie.join("&");
                break;
            }
        }
        if (isNeedModif || !isFound) {
            if (window.location.hostname.includes("aliexpress.ru")) {
                document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2088 03:14:07 GMT; domain=.aliexpress.ru`;
                window.location.reload();
            } else if (window.location.hostname.includes("aliexpress.com")) {
                document.cookie = `aep_usuc_f=${str}; path=/; expires=Tue, 19 Jan 2088 03:14:07 GMT; domain=.aliexpress.com`;
                window.location.reload();
            } else {alert("Ошибка в скрипте")};
            btn.classList.add("yes-modify-btn");
            setTimeout(() => {btn.classList.remove("yes-modify-btn");}, 300);
            window.location.reload();
        } else {
            btn.classList.add("no-modify-btn");
            setTimeout(() => {btn.classList.remove("no-modify-btn");}, 300);
        }
    }

})();
Для проверки страны с бесплатной отправкой просто супер:wassat:
 
как нажимать кнопку blast в пистолете с помощью джава скрипта ?
 
Скрипт отображает минимальную доставку сразу на несколько стран
1612582951567.png
JavaScript:
// ==UserScript==
// @name         Aliexpress shipping getter
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Получает цену доставки на указанные страны
// @author       Andronio
// @match        https://aliexpress.ru/item/*
// @match        https://aliexpress.com/item/*
// @match        https://www.aliexpress.com/item/*
// @match        https://www.aliexpress.ru/item/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==
let shipping_getter_count = 10;
(function repeat() {
    'use strict';
/*
 * Настройки
 */

let myCountry = ["KZ", "RU", "US", "BY", "UA"];

/*
 * Дальше не трогать
 */
    if (--shipping_getter_count == 0) return console.log("Не смог найти доставку");
    let shipping = document.querySelector('.product-shipping');
    if (!shipping) return setTimeout(repeat, 1000);
    let item = location.pathname.match(/\d+(?=\.html)/);
    let host = location.host;
    let freightMass = window.runParams.data.skuModule.skuPriceList.slice();
    freightMass.sort( (a,b) => a.skuVal.actSkuCalPrice - b.skuVal.actSkuCalPrice);
    let minPrice = encodeURIComponent(freightMass[0].freightExt);
    let requests = myCountry.map(el => {
        return fetch(`https://${host}/aeglodetailweb/api/logistics/freight?productId=${item}&count=1&country=${el}&tradeCurrency=USD&userScene=PC_DETAIL_SHIPPING_PANEL&displayMultipleFreight=false&ext=${minPrice}`, {
            "headers": {
                "accept": "application/json, text/plain, */*",
                "accept-language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
            },
            "referrer": `https://${host}/item/${item}.html`,
            "referrerPolicy": "no-referrer-when-downgrade",
            "body": null,
            "method": "GET",
            "credentials": "include"
        });
    });
    Promise.all(requests)
        .then(responses => Promise.all(responses.map(r => r.json())))
        .then(freight => {
        freight.forEach(obj => {
            obj.body.freightResult.map(el => console.log(el.freightAmount.value))
            obj.body.freightResult.sort( (a,b) => a.freightAmount.value - b.freightAmount.value)
            obj.body.freightResult.map(el => console.log(el.freightAmount.value))
            return obj;
        });
        let div = document.createElement('div');
        div.className = "table-shipping";
        let str = '<table border="1">';
        for (let i = 0; i < myCountry.length; i++) {
            str += `<tr><td>${myCountry[i]}</td><td>${freight[i].body.freightResult[0].freightAmount.formatedAmount}</td></tr>`;
        }
        div.innerHTML = str + '</table>';
        shipping.append(div);

        let styles = `
            .table-shipping td{
                padding: 1px 20px;
        }`;

        let styleSheet = document.createElement('style');
        styleSheet.type = "text/css";
        styleSheet.innerHTML = styles;
        document.head.append(styleSheet);
    });
})();
 
Обновил скрипт входа в Cash4Brands, старый перестал работать
Ссылка на гитхаб
---------Двойное сообщение соединено: ---------
Обновил скрипт входа на Алиэкспресс, теперь обходит слайд при входе.
Ссылка на гитхаб
Подскажите, скрипт для Cash4Brands работает? а то у меня нет
 
Последнее редактирование:
Исправил скрипт https://mipped.com/f/threads/skripty-na-javascript-dlja-aliehkspress.105115/post-2909141, скрипт падал, если в страну не было доставки.

JavaScript:
// ==UserScript==
// @name         Aliexpress shipping getter
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Получает цену доставки на указанные страны
// @author       Andronio
// @match        https://aliexpress.ru/item/*
// @match        https://aliexpress.com/item/*
// @match        https://www.aliexpress.com/item/*
// @match        https://www.aliexpress.ru/item/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==
let shipping_getter_count = 10;
(function repeat() {
    'use strict';
/*
 * Настройки
 */

let myCountry = ["KZ", "RU", "US", "BY", "UA", "ME", "RS", "HR"];

/*
 * Дальше не трогать
 */
    if (--shipping_getter_count == 0) return console.log("Не смог найти доставку");
    let shipping = document.querySelector('.product-shipping');
    if (!shipping) return setTimeout(repeat, 1000);
    let item = location.pathname.match(/\d+(?=\.html)/);
    let host = location.host;
    let freightMass = window.runParams.data.skuModule.skuPriceList.slice();
    freightMass.sort( (a,b) => a.skuVal.actSkuCalPrice - b.skuVal.actSkuCalPrice);
    let minPrice = encodeURIComponent(freightMass[0].freightExt);
    let requests = myCountry.map(el => {
        return fetch(`https://${host}/aeglodetailweb/api/logistics/freight?productId=${item}&count=1&country=${el}&tradeCurrency=USD&userScene=PC_DETAIL_SHIPPING_PANEL&displayMultipleFreight=false&ext=${minPrice}`, {
            "headers": {
                "accept": "application/json, text/plain, */*",
                "accept-language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
            },
            "referrer": `https://${host}/item/${item}.html`,
            "referrerPolicy": "no-referrer-when-downgrade",
            "body": null,
            "method": "GET",
            "credentials": "include"
        });
    });
    Promise.all(requests)
        .then(responses => Promise.all(responses.map(r => r.json())))
        .then(freight => {
        freight.forEach(obj => {
            if (obj.body.hasOwnProperty("freightResult")) {
                obj.body.freightResult.map(el => console.log(el.freightAmount.value));
                obj.body.freightResult.sort( (a,b) => a.freightAmount.value - b.freightAmount.value);
                obj.body.freightResult.map(el => console.log(el.freightAmount.value));
            }
            return obj;
        });
        let div = document.createElement('div');
        div.className = "table-shipping";
        let str = '<table border="1">';
        for (let i = 0; i < myCountry.length; i++) {
            let str2 = freight[i].body.hasOwnProperty("freightResult") ? freight[i].body.freightResult[0].freightAmount.formatedAmount : '---';
            str += `<tr><td>${myCountry[i]}</td><td>${str2}</td></tr>`;
        }
        div.innerHTML = str + '</table>';
        shipping.append(div);

        let styles = `
            .table-shipping td{
                padding: 1px 20px;
        }`;

        let styleSheet = document.createElement('style');
        styleSheet.type = "text/css";
        styleSheet.innerHTML = styles;
        document.head.append(styleSheet);
    });
})();
---------Двойное сообщение соединено: ---------
Ещё одна новая версия. Можно переключать либо название доставки, либо код доставки. Нужно указать порядок стран откуда, для страниц, где есть выбор откуда доставлять.
1612770799044.png


JavaScript:
// ==UserScript==
// @name         Aliexpress shipping getter
// @namespace    http://tampermonkey.net/
// @version      1.0
// @description  Получает цену доставки на указанные страны
// @author       Andronio
// @match        https://aliexpress.ru/item/*
// @match        https://aliexpress.com/item/*
// @match        https://www.aliexpress.com/item/*
// @match        https://www.aliexpress.ru/item/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==
let shipping_getter_count = 10;
(function repeat() {
    'use strict';
/*
 * Настройки
 */

let myCountry = ["RU", "KZ", "ALA"];
let fromCountry = ["RU", "CN"];  // Страны "откуда" в порядке предпочтения
let serviceName = 1;             // 1 - название, 0 - код сервиса
/*
 * Дальше не трогать
 */
    if (--shipping_getter_count == 0) return console.log("Не смог найти доставку");
    let shipping = document.querySelector('.product-shipping');
    if (!shipping) return setTimeout(repeat, 1000);
    let item = location.pathname.match(/\d+(?=\.html)/);
    let host = location.host;
    let skuProp = window.runParams.data.skuModule;
    let freightMass = window.runParams.data.skuModule.skuPriceList.slice();
    let foundCountry = false;
    if (skuProp.hasOwnProperty("productSKUPropertyList")) {
        fromCountry.some(country => {                   // Если есть хоть одна проперти, то смотрим
            let propIndex = skuProp.productSKUPropertyList.findIndex( el => el.skuPropertyId === 200007763);        // Ищем проперти "отправка из"
            if (propIndex != -1) {
                let countryIndex = skuProp.productSKUPropertyList[propIndex].skuPropertyValues.findIndex( el => el.skuPropertySendGoodsCountryCode == country) // Ищем нужную страну
                if (countryIndex != -1) {
                    let countryCode = skuProp.productSKUPropertyList[propIndex].skuPropertyValues[countryIndex].propertyValueId; // Код страны
                    let mass = freightMass.filter( el => (el.skuPropIds.split(',').some(pr => +pr == countryCode) && el.skuVal.availQuantity > 0)); // ищем элементы нужной страны и на складе > 0
                    if (mass.length > 0) {
                        freightMass = mass;
                        foundCountry = country;
                        return true;
                    }
                }
            }
        })
    }
    freightMass.sort( (a,b) => a.skuVal.actSkuCalPrice - b.skuVal.actSkuCalPrice);
    let minPrice = encodeURIComponent(freightMass[0].freightExt);
    let requests = myCountry.map(el => {
        return fetch(`https://${host}/aeglodetailweb/api/logistics/freight?productId=${item}&count=1&country=${el}&tradeCurrency=USD&userScene=PC_DETAIL_SHIPPING_PANEL&displayMultipleFreight=false&ext=${minPrice}`, {
            "headers": {
                "accept": "application/json, text/plain, */*",
                "accept-language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
            },
            "referrer": `https://${host}/item/${item}.html`,
            "referrerPolicy": "no-referrer-when-downgrade",
            "body": null,
            "method": "GET",
            "credentials": "include"
        });
    });
    Promise.all(requests)
        .then(responses => Promise.all(responses.map(r => r.json())))
        .then(freight => {
        freight.forEach(obj => {
            if (obj.body.hasOwnProperty("freightResult")) {
                obj.body.freightResult.sort( (a,b) => a.freightAmount.value - b.freightAmount.value);
            }
            return obj;
        });
        let div = document.createElement('div');
        div.className = "table-shipping";
        let str = '<table border="1">';
        for (let i = 0; i < myCountry.length; i++) {
            if (freight[i].body.hasOwnProperty("freightResult") && freight[i].body.freightResult.filter( el => !foundCountry ? true: el.sendGoodsCountry == foundCountry).length > 0) {
                let freeSh = freight[i].body.freightResult.filter( el => el.freightAmount.value == 0 && (!foundCountry ? true: el.sendGoodsCountry == foundCountry));
                if (freeSh.length == 0) {
// Если нет бесплатной доставки
                    let str2 = freight[i].body.freightResult[0].freightAmount.formatedAmount;
                    let str3 = serviceName ? freight[i].body.freightResult[0].company : freight[i].body.freightResult[0].serviceName;
                    str += `<tr><td>${myCountry[i]}</td><td>${str2}</td><td>${str3}</td></tr>`;
                } else {
// Бесплатная доставка
                    freeSh.forEach( (el, index) => {
                        let str3 = serviceName ? el.company : el.serviceName;
                        str += index ? `<tr><td style="background:lightgreen">Free</td><td>${str3}</td></tr>` : `<tr><td rowspan=${freeSh.length}>${myCountry[i]}</td><td style="background:lightgreen">Free</td><td>${str3}</td></tr>`;
                    });
                }
            } else {
                str += `<tr><td>${myCountry[i]}</td><td colspan=2 style="background:OrangeRed">---</td></tr>`;
            }
        }
        div.innerHTML = str + '</table>';
        shipping.append(div);

        let styles = `
            .table-shipping table{
                border-collapse: collapse;
            }
            .table-shipping td{
                padding: 1px 20px;
            }`;

        let styleSheet = document.createElement('style');
        styleSheet.type = "text/css";
        styleSheet.innerHTML = styles;
        document.head.append(styleSheet);
    });
})();
 
Последнее редактирование:
Исправил скрипт https://mipped.com/f/threads/skripty-na-javascript-dlja-aliehkspress.105115/post-2909141, скрипт падал, если в страну не было доставки.

JavaScript:
// ==UserScript==
// @name         Aliexpress shipping getter
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  Получает цену доставки на указанные страны
// @author       Andronio
// @match        https://aliexpress.ru/item/*
// @match        https://aliexpress.com/item/*
// @match        https://www.aliexpress.com/item/*
// @match        https://www.aliexpress.ru/item/*
// @grant        none
// @run-at       document-idle
// ==/UserScript==
let shipping_getter_count = 10;
(function repeat() {
    'use strict';
/*
* Настройки
*/

let myCountry = ["KZ", "RU", "US", "BY", "UA", "ME", "RS", "HR"];

/*
* Дальше не трогать
*/
    if (--shipping_getter_count == 0) return console.log("Не смог найти доставку");
    let shipping = document.querySelector('.product-shipping');
    if (!shipping) return setTimeout(repeat, 1000);
    let item = location.pathname.match(/\d+(?=\.html)/);
    let host = location.host;
    let freightMass = window.runParams.data.skuModule.skuPriceList.slice();
    freightMass.sort( (a,b) => a.skuVal.actSkuCalPrice - b.skuVal.actSkuCalPrice);
    let minPrice = encodeURIComponent(freightMass[0].freightExt);
    let requests = myCountry.map(el => {
        return fetch(`https://${host}/aeglodetailweb/api/logistics/freight?productId=${item}&count=1&country=${el}&tradeCurrency=USD&userScene=PC_DETAIL_SHIPPING_PANEL&displayMultipleFreight=false&ext=${minPrice}`, {
            "headers": {
                "accept": "application/json, text/plain, */*",
                "accept-language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
            },
            "referrer": `https://${host}/item/${item}.html`,
            "referrerPolicy": "no-referrer-when-downgrade",
            "body": null,
            "method": "GET",
            "credentials": "include"
        });
    });
    Promise.all(requests)
        .then(responses => Promise.all(responses.map(r => r.json())))
        .then(freight => {
        freight.forEach(obj => {
            if (obj.body.hasOwnProperty("freightResult")) {
                obj.body.freightResult.map(el => console.log(el.freightAmount.value));
                obj.body.freightResult.sort( (a,b) => a.freightAmount.value - b.freightAmount.value);
                obj.body.freightResult.map(el => console.log(el.freightAmount.value));
            }
            return obj;
        });
        let div = document.createElement('div');
        div.className = "table-shipping";
        let str = '<table border="1">';
        for (let i = 0; i < myCountry.length; i++) {
            let str2 = freight[i].body.hasOwnProperty("freightResult") ? freight[i].body.freightResult[0].freightAmount.formatedAmount : '---';
            str += `<tr><td>${myCountry[i]}</td><td>${str2}</td></tr>`;
        }
        div.innerHTML = str + '</table>';
        shipping.append(div);

        let styles = `
            .table-shipping td{
                padding: 1px 20px;
        }`;

        let styleSheet = document.createElement('style');
        styleSheet.type = "text/css";
        styleSheet.innerHTML = styles;
        document.head.append(styleSheet);
    });
})();
У меня 2-я версия на Firefox не работает , Просто не появляется табличка. Первая и третья ок