Skip to content

Instantly share code, notes, and snippets.

@kikairoya
Created April 5, 2013 15:40
Show Gist options
  • Save kikairoya/5320292 to your computer and use it in GitHub Desktop.
Save kikairoya/5320292 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name enforce japanese
// @include *
// ==/UserScript==
(function () {
var html = document.getElementsByTagName("html")[0];
if (!html) return;
if (!html.lang) {
var c = document.characterSet;
if (!c) {
html.lang = "ja";
} else {
switch (c) {
case "utf-8":
case "utf8":
case "UTF-8":
case "UTF8":
case "utf_8":
case "UTF_8":
html.lang = "ja";
}
}
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment