Skip to content

Instantly share code, notes, and snippets.

@gozen-bro3
Created February 13, 2014 01:55
Show Gist options
  • Save gozen-bro3/8968322 to your computer and use it in GitHub Desktop.
Save gozen-bro3/8968322 to your computer and use it in GitHub Desktop.
1件のみの敵襲ランプを非表示にする
// ==UserScript==
// @id bro3_noAlarm
// @name 1件のみの敵襲ランプを非表示にする
// @version 1.01
// @include http://m*.3gokushi.jp/village.php*
// @run-at document-end
// ==/UserScript==
// 2013.04.26 要望があったので作成
(function(){
var action1 = xpath('//div[@id="action"]/div[@class="floatInner"]/ul/li', document);
var action4 = xpath('//div[@id="action"]/div[@class="floatInner"]/ul/li', document);
var len = action1.snapshotLength;
for (var i=0;i<len;i++){
if (action4.snapshotItem(i).innerHTML.replace(/\n/g, "").replace(/\r/g, "").indexOf("敵襲</a>1 ") > 0){
xpath('//div[@id="statusIcon"]/a/img', document).snapshotItem(0).src = "./20130426-01/extend_project/w760/img/common/icon_header_status_no.gif";
}
}
})();
function xpath(query,targetDoc) {
return document.evaluate(query, targetDoc, null,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment