Skip to content

Instantly share code, notes, and snippets.

@oquno
Created November 10, 2010 11:30
Show Gist options
  • Save oquno/670726 to your computer and use it in GitHub Desktop.
Save oquno/670726 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name better Lyric
// @namespace http://oquno.com/
// @include http://music.goo.ne.jp/lyric/LYR*
// @description fix goo music lyric
// ==/UserScript==
(function(){
unsafeWindow.appendLyric = function(data){
document.querySelector('#canvas').style.display = 'none';
var kashi = document.createElement('div');
for(var i = 0; i < data.length; i++){
var p = document.createElement('span');
p.innerHTML = data[i] + "<br />";
kashi.appendChild(p);
}
document.getElementById("lyric_area").appendChild(kashi);
}
var script = document.querySelectorAll("#incontents script")[1];
var api = script.innerHTML.match(/'(\/.*print_json[^']*)'/)[1].replace(/draw/, 'appendLyric');
var insert = document.createElement('script');
insert.src = api;
document.querySelectorAll('head')[0].appendChild(insert);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment