diff --git a/settings.html b/settings.html
index 48966758..b0bd696f 100644
--- a/settings.html
+++ b/settings.html
@@ -1622,6 +1622,7 @@
// country's capital (or biggest city) so pages that geocode the position
// land in the right country. Alphabetised for the dropdown.
const COUNTRIES = {
+ AE: ["United Arab Emirates", 25.2048, 55.2708],
AR: ["Argentina", -34.6037, -58.3816],
AT: ["Austria", 48.2082, 16.3738],
AU: ["Australia", -33.8688, 151.2093],
@@ -1701,7 +1702,10 @@
// has a valid value and the settings file is normalised on next save.
const initialMode = (() => {
if (s.locationMode === "spoof") {
- const code = REGION_TO_COUNTRY[s.locationRegion] || "DE";
+ // Every region must map to a COUNTRIES entry: this runs before the
+ // rest of the page is wired, so a throw here (middle_east -> AE, once
+ // missing from COUNTRIES) left Plug-ins and everything below it dead.
+ const code = COUNTRIES[REGION_TO_COUNTRY[s.locationRegion]] ? REGION_TO_COUNTRY[s.locationRegion] : "DE";
const [, la, lo] = COUNTRIES[code];
C.set("locationCountry", code);
C.set("locationLat", String(la));