// ==/UserScript==
(function()
{
var pics = document.getElementsByTagName("img");
var re = /www\.getchu\.com/ig;
for ( var i = 0, pic; pic = pics; i++ )
{
if (pic.src.indexOf ("www.getchu.com") > 0)
{
pic.src = pic.src.replace(re,"210.155.150.152");
}
}
var scripts = document.getElementsByTagName("script");
var re = /www\.getchu\.com/ig;
for ( var h = 0, script; script = scripts[h]; h++ ) {
if (script.src.indexOf ("www.getchu.com") > 0)
{
script.src = script.src.replace(re,"210.155.150.152");
loadJs (script.src);
}
}
var csss = document.getElementsByTagName("css");
var re = /www\.getchu\.com/ig;
for ( var r = 0, css; css = csss[r]; r++ ) {
if (css.src.indexOf ("www.getchu.com") > 0)
{
css.src = css.src.replace(re,"210.155.150.152");
loadCss (css.src);
}
}
var bks = document.getElementsByTagName("link");
var re = /www\.getchu\.com/ig;
for ( var d = 0, bk; bk = bks[d]; d++ )
{
if (bk.href.indexOf ("www.getchu.com") > 0)
{
bk.href = bk.href.replace(re,"210.155.150.152");
}
}
}
)();
function loadJs(file){
var scriptTag = document.getElementById('loadScript');
var head = document.getElementsByTagName('head').item(0);
if(scriptTag) head.removeChild(scriptTag);
script = document.createElement('script');
script.src = file;
script.type = 'text/javascript';
script.id = 'loadScript';
head.appendChild(script);
}
function loadCss(file){
var cssTag = document.getElementById('loadCss');
var head = document.getElementsByTagName('head').item(0);
if(cssTag) head.removeChild(cssTag);
css = document.createElement('link');
css.href = file;
css.rel = 'stylesheet';
css.type = 'text/css';
css.id = 'loadCss';
head.appendChild(css);
} 作者: gtoicac 时间: 2010-01-28 15:57