Created
April 5, 2013 15:40
-
-
Save kikairoya/5320292 to your computer and use it in GitHub Desktop.
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 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