How to enter a Swiss address on AliExpress.
AliExpress has a stupid interface for entering your address – it makes you select the country, then the canton/region/state, then the city, all from drop-down lists. Of course, their drop-down lists are incomplete: e.g., for most cantons in Switzerland, they only have the capital city and nothing else.
If you contact their support, they will tell you to select the “other” option. But this option is only available on the web, not in their app, and even there it does not work due to what seems to be an obvious bug in their code.
Here is how to work it around. You will need a desktop computer for this, I do not know of an easy way to do the same from your phone.
The instructions that follow are for Firefox as it is what I use, but it should be pretty much exactly the same on Chrome (one difference is that the “Debugger” tab is called “Sources” there). If you try to do this in Chrome, let me know how it goes and what differences you encounter, so that I can update the instructions accordingly.
Go to your settings, start adding a new address. In the “country” field, select “Other Country”:
Then just fill in your details:
I feel like there should be an easier way to do this, but I could not figure it out. Please comment below if you have any ideas.
Open Developer Tools: go to Browser menu → More tools → Web Developer Tools (or press Ctrl+Shift+I / ⌘+⌥+I on macOS).
Click the “Debugger” tab:
On the right, expand “XHR Breakpoints” and set the checkbox next to “Pause on any URL”:
Press the red “Confirm” button on the page to submit your new address. The AliExpress page will freeze, this is normal, just keep working with the Developer Tools.
Press the { }
button at the bottom left of the code area (right below the line numbers):
Now uncheck “Pause on any URL” in the right panel.
Notice the highlighted line in the code area. Right-click its line number, select “Add breakpoint”. Right-click the same line number again, select “Add condition”, and type Sr.name == "send"
in the input field that appears:
Press enter; the marker on the line number should turn from blue to amber.
We are now ready to hack the request!
Press the “play” button on the panel overlayed over the frozen page:
This will unfreeze the page.
Now click “Confirm“ for the second time, the page will freeze again, but this time we get a chance to edit the request before it is sent to the server.
Note what it says after this,
in the highlighted line of code. In my screenshots, it is a
, but they might change it in the future. If you see something different from a
, then substitute what you see in the next steps.
Under “Breakpoints” on the right panel, remove the breakpoint with Sr.name == "send"
and the number of our line of code:
Go to the “Console” tab of the Developer Tools. (There will be a bunch of amber warnings and red errors there, just ignore them, this is how people write code nowadays, not much we can do about it.)
In the input field at the bottom of the console, type: a[0] = a[0].replace("OTHER", "CH")
:
Press “Enter”. Ok, done, you have just set the correct country (CH
for Switzerland) in your brand-new address.
Now press the “play” button on the page once again.
You should see a bunch of stuff happening and, eventually, you will get redirected back to the page with your addresses, where you will find your new address added. You can close Developer Tools at this point.
In my experiments, I would always end up with “undefined” in the “apartment” field. You can now just click “Edit” and edit your address normally to revert the “apartment” field to empty. Just be careful not to touch the “city” field :).
Unfortunately, it does not seem to work for me - the cURL request fails with
{"errorMsg":"system error:no privilege","fieldErrorMessageList":[],"success":false}
EDIT: Works like a charm with BurpSuite. It looks like each request now has a one-time token attached.