Created
November 20, 2011 22:58
-
-
Save t-f-m/1381104 to your computer and use it in GitHub Desktop.
「社長が訊く」をAutoPagerizeで読んだときの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
// ==UserScript== | |
// @name Nintendo president interviwer with autopagerize | |
// @namespace http://d.hatena.ne.jp/t_f_m/ | |
// @description 「社長が訊く」内の文字欠けを何とかする | |
// @include http://www.nintendo.co.jp/*/interview/* | |
// ==/UserScript== | |
function boot(){ | |
window.AutoPagerize = window.AutoPagerize || sharedObject.AutoPagerize; | |
//sharedObjectによる一部オブジェクト共有 | |
//グリモン版を使う場合細工済みのもののみ可 | |
var scriptTouch = function(doc, url, info){ | |
var scripts = doc.getElementsByTagName('script') | |
for(var i=0, l = scripts.length; i < l ; ++i){ | |
var scr = scripts[i] | |
try{ | |
var raw = scr.innerHTML.match(/(?:document.write\('(<A .+<\/A>)'\))/)[1] | |
if(raw){ | |
var sc = document.createElement('span') | |
sc.innerHTML = raw | |
scr.parentNode.insertBefore(sc,scr.nextSibling) | |
} | |
}catch(e){ | |
} | |
} | |
if(raw){//scriptが見つかった場合のみpage側で初期化 | |
location.href = 'javascript: void tb_init(\'span>a.thickbox\')' | |
} | |
} | |
window.AutoPagerize.addDocumentFilter(scriptTouch) | |
} | |
if(window.AutoPagerize || sharedObject.AutoPagerize){ | |
boot() | |
}else{ | |
window.addEventListner('GM_AutoPagerizeLoaded',boot,false); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment