Skip to content

Instantly share code, notes, and snippets.

@st63jun
Last active December 31, 2015 03:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save st63jun/7926169 to your computer and use it in GitHub Desktop.
Save st63jun/7926169 to your computer and use it in GitHub Desktop.
Googleの検索結果から ja.softuses.com を消すユーザースクリプト
// ==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