Skip to content

Instantly share code, notes, and snippets.

@t-ashula
Created September 6, 2011 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t-ashula/1196646 to your computer and use it in GitHub Desktop.
Save t-ashula/1196646 to your computer and use it in GitHub Desktop.
Opera UserJS for NHK netradio ラジル★ラジル(2)
(function(w,o,l){
if( /^http:\/\/www3.nhk.or.jp\/netradio\/player\//.test( l.href ) ) {
o.addEventListener( 'BeforeScript', function( e ) {
if ( /common.js/.test(e.element.src) ) {
e.element.text = e.element.text.replace( /\(lis\);/g, "(lis.documentElement.innerHTML.replace(/<head>.+<\\\/head>/,'').replace(/<\\\/?body>/g,''));" );
}
if ( !e.element.src ) {
if ( e.element.text.match(/var ch=window.location/) ) {
e.element.text = e.element.text.replace(/var ch=window.location.+;/, "var ch = location.search.substring(1); ch = /^(r1|r2|fm)$/.test(ch) ? ch : 'r1' ");
}
}
}, false );
}
})(window,opera,location);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment