Skip to content

Instantly share code, notes, and snippets.

@matheusfaustino
Last active July 22, 2017 14:04
Show Gist options
  • Save matheusfaustino/5f3582e234f3d142ff8df2db4ce4f472 to your computer and use it in GitHub Desktop.
Save matheusfaustino/5f3582e234f3d142ff8df2db4ce4f472 to your computer and use it in GitHub Desktop.
Mozilla Dev Website Always Eng (UserScript)
// ==UserScript==
// @name Mozilla Dev Website Always Eng
// @namespace mozilla.dev.docs.always.eng
// @author matheusfaustino
// @description Always change the language of mozilla docs to English
// @include https://developer.mozilla.org/*/docs/*
// @exclude https://developer.mozilla.org/en*/docs/*
// @version 1
// @grant none
// ==/UserScript==
function changeToEnglish() {
let languages = [].slice.call(document.querySelectorAll('#languages-menu-submenu ul li a'));
let english_url = '';
for(let i=0; i < languages.length && !english_url; i++)
if (languages[i].getAttribute('href').indexOf('en-US') != -1)
english_url = languages[i].getAttribute('href');
window.location.replace(english_url);
}
document.addEventListener('DOMContentLoaded', () => changeToEnglish() );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment