Skip to content

Instantly share code, notes, and snippets.

@cmilanf
Created April 8, 2020 22:44
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmilanf/67f631327ae76100da97c76900d65ca0 to your computer and use it in GitHub Desktop.
Save cmilanf/67f631327ae76100da97c76900d65ca0 to your computer and use it in GitHub Desktop.
UserScript to make docs.microsoft.com display always the en-us URL
// ==UserScript==
// @name docs.microsoft.com always en-us
// @namespace http://calnus.com
// @version 0.1
// @description Sets the docs.microsoft.com URL to en-us
// @author Carlos Milán Figueredo
// @match https://docs.microsoft.com/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
var urlPath = window.location.pathname;
if (urlPath.indexOf('en-us') == -1) {
var urlLanguage=urlPath.split('/')[1];
var newPath=urlPath.replace(urlLanguage,'en-us');
window.location.replace(window.location.protocol + '//'
+ window.location.hostname
+ newPath);
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment