Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.