Skip to content

Instantly share code, notes, and snippets.

@kballenegger
Last active January 3, 2023 06:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kballenegger/9e74bef91b745399d721dec5fceb24b9 to your computer and use it in GitHub Desktop.
Save kballenegger/9e74bef91b745399d721dec5fceb24b9 to your computer and use it in GitHub Desktop.
Force IHG to speak English
// ==UserScript==
// @name IHG English
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Force IHG site to English
// @author Kenneth Ballenegger
// @match https://www.ihg.com/hotels/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=kswizz.com
// @grant none
// ==/UserScript==
(function() {
'use strict';
const currentUrl = new URL(window.location.href);
const regex = /^\/hotels\/(?!us\/en)..\/../;
if (regex.test(currentUrl.pathname)) {
currentUrl.pathname = currentUrl.pathname.replace(regex, '/hotels/us/en');
window.history.replaceState(null, null, currentUrl.toString());
location.reload();
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment