Created
April 8, 2020 22:44
-
-
Save cmilanf/67f631327ae76100da97c76900d65ca0 to your computer and use it in GitHub Desktop.
UserScript to make docs.microsoft.com display always the en-us URL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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