Firefox userChrome.js greasemonkeyスクリプトスレ13
■ このスレッドは過去ログ倉庫に格納されています
0346名無しさん@お腹いっぱい。
2010/09/25(土) 02:37:18ID:jm9mBkCU0(function() {
window.addEventListener('load', function(){
/*開始*/
var start = new Date();
const PATTERN = {
__proto__: null,
'firefox' : 'ファイアーフォックス'
};
const PATTERN_SHORTCUT = RegExp([x for (x in PATTERN)].join('|'), 'gi');
replace(document);
document.addEventListener('DOMNodeInserted', function(event) {
replace(event.target);
}, false);
function replace(target) {
target.normalize();
var x = document.evaluate('descendant::text()', target, null, 6, null);
for (var i = 0, len = x.snapshotLength; i < len; i++) {
var textNode = x.snapshotItem(i);
textNode.nodeValue = textNode.nodeValue.replace(PATTERN_SHORTCUT, function($0) PATTERN[$0.toLowerCase()]);
}
}
■ このスレッドは過去ログ倉庫に格納されています