Last active
July 6, 2022 08:33
-
-
Save nick133/1c48348a2ffeed6b5f18e4100929b262 to your computer and use it in GitHub Desktop.
Fix Aliexpress Country/Currency settings
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
/// | |
/// !!! Outdated - Not working with current aliexpress version !!! | |
/// | |
// ==UserScript== | |
// @name Aliexpress fix locale | |
// @description Fix Aliexpress country and currency settings | |
// @icon https://www.aliexpress.com/favicon.ico | |
// @version 1 | |
// @grant none | |
// @match https://*.aliexpress.com/* | |
// ==/UserScript== | |
var idCurrencyText = "USD" | |
var idCurrencyIndex = "0" | |
var idCountryIndex = "220" // Ukraine | |
window.onload = (event) => { | |
// Set USD currency and country | |
if (document.getElementsByClassName("css_flag css_ua").length == 0 | |
|| document.getElementsByClassName("currency")[0].innerText != idCurrencyText) { | |
// Open Menu | |
document.getElementById("switcher-info").click() | |
//Wait for Menu to load as it is in external script | |
setTimeout(() => { | |
// Menu select country | |
document.querySelectorAll("[data-name]")[idCountryIndex].click() | |
// Menu select currency | |
document.querySelectorAll("[data-currency]")[idCurrencyIndex].click() | |
// Menu Save settings | |
document.getElementsByClassName("ui-button ui-button-primary go-contiune-btn")[0].click() | |
}, 1000) | |
} | |
} |
Hi! I want to use your script but I can't find a list of the country indexes. Can you help me? Thanks :)
They brake this script with the latest website updates, it doesn't work anymore, sorry. Need to dig deep inside the code again, the changed country indexes to country codes (letters)
Oh.. OK thanks!
Could you please add a comment in the code so others will know this easily?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! I want to use your script but I can't find a list of the country indexes. Can you help me? Thanks :)