Skip to content

Instantly share code, notes, and snippets.

@pblocz
Created January 21, 2019 17:17
Show Gist options
  • Save pblocz/ebf64e02be581b6cf0b18e39495a5e73 to your computer and use it in GitHub Desktop.
Save pblocz/ebf64e02be581b6cf0b18e39495a5e73 to your computer and use it in GitHub Desktop.
Redirect to english Microsoft docs
// ==UserScript==
// @name redict-microsoft
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Redirect to english Microsoft docs
// @author Pablo Cabeza Garcia
// @match https://*.microsoft.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var url = window.location.href;
var regex = /(https:\/\/\w+.microsoft.com\/)(\w+-\w+)(\/.*)/
var m = regex.exec(url);
if (m != null && m[2] != "en-us") {
url = url.replace(regex, "$1en-us$3");
window.location.href = url;
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment