Last active
December 31, 2015 03:18
-
-
Save st63jun/7926169 to your computer and use it in GitHub Desktop.
Googleの検索結果から ja.softuses.com を消すユーザースクリプト
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 Kill ja.softuses.com | |
// @namespace https://gist.github.com/st63jun/7926169 | |
// @description Googleの検索結果から ja.softuses.com を無慈悲に削除 | |
// @include https://www.google.co.jp/* | |
// @include https://www.google.com/* | |
// @include https://encrypted.google.com/* | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
var id = -1; | |
id = window.setInterval(function() { | |
var footer = document.evaluate( | |
"//div[@id='footcnt']", | |
document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null | |
); | |
if (footer.snapshotLength > 0) { | |
var softuses = document.evaluate( | |
"//li[@class='g']/div/h3/a/@href[contains(., 'http://ja.softuses.com')]/../../../..", | |
document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null | |
); | |
for (var i = softuses.snapshotLength - 1; i >= 0; i--) { | |
var elm = softuses.snapshotItem(i); | |
elm.style.display = "none"; | |
} | |
window.clearInterval(id); | |
} | |
}, 100); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment