Skip to content

Instantly share code, notes, and snippets.

@vietqhoang
Created June 26, 2013 19:13
Show Gist options
  • Select an option

  • Save vietqhoang/5870553 to your computer and use it in GitHub Desktop.

Select an option

Save vietqhoang/5870553 to your computer and use it in GitHub Desktop.
Change font-weight for all attribute lang-ja in the document. Use with a script injector extension, such as Tampermonkey for Chrome or GreaseMonkey for Firefox.
// ==UserScript==
// @name KanaEagleVision
// @namespace http://www.wanikani.com
// @version 0.1
// @description Changes font-weight to normal for anything attributed with lang=ja. jQuery inject script from https://gist.github.com/eristoddle/4440713
// ==/UserScript==
function addJQuery(callback) {
var script = document.createElement("script");
script.setAttribute("src", "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js");
script.addEventListener('load', function() {
var script = document.createElement("script");
script.textContent = "window.jQ=jQuery.noConflict(true);(" + callback.toString() + ")();";
document.body.appendChild(script);
}, false);
document.body.appendChild(script);
}
function fontWeightChange(){
$(document).ready(function() {
$('[lang=ja]').css('font-weight', 'normal');
});
}
// load jQuery and execute the main function
addJQuery(fontWeightChange);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment