Hey everybody,
Another heads-up is needed as the W.location object is going to be removed in an upcoming version of the WME.
I’ve checked the sources of an array of popular scripts and found these scripts to be affected by this change:
UROverview Plus
WME Bookmarks
WME Form Filler
WME LiveMap Alerts Overlay
WME LiveMap Closures
WME Map Tiles Update
WME True Segment Length
I haven’t got all userscripts here and I’m also not checking extensions such as WME Toolbox, so I am most certainly still missing scripts in this list.
As for a way to migrate, you can use this bit of code to replace W.location.code (or you can use an if statement if you don’t like this shorthand notation). This supports both the old and new objects. After the new version has been released, only the last part will be needed.
EDIT: we no longer need to support the old object.
W.app.getAppRegionCode()
Another property of W.location that is apparently used from time to time would be W.location.locale. For this, the solution is simple: use I18n.locale, which is already available. I haven’t found any scripts using W.location.locale, but that doesn’t mean anything.
If you’ve got any questions or remarks, feel free to add them here!