Created
September 6, 2011 05:10
-
-
Save t-ashula/1196646 to your computer and use it in GitHub Desktop.
Opera UserJS for NHK netradio ラジル★ラジル(2)
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
(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