ほとんどのブラウザ (Greasemonkey): インターネット上の特定のサイトが特に便利であることがわかった場合は、簡単なユーザー スクリプトを使用して、Google、Bing、Yahoo の検索結果にそのサイトが表示されるたびに強調表示できます。
実は私がライフハッカーを知ったのは、Google の検索結果に何度も表示されていたからです (そして結局役に立ちました)。今でも、何か方法を探すときに役立つサイトがいくつかありますが、Google 検索でその存在に気づかずに通り過ぎてしまうことがよくあります。ただし、簡単なユーザー スクリプトを使用すると、お気に入りのサイトを (選択した色で) 強調表示して、表示されたときに見逃さないようにすることができます。以下のコードをコピーし、その下のドメインを置き換えるだけです。var sites
追跡したいドメインを行に追加します。各サイトの隣には HTML カラーコードもあり、必要に応じてカスタマイズできます。このテーブル正しいコードを見つけるために。
// ==UserScript==// @name Locate Multiple Domains in Search Results// @filename multiple-domains.user.js// @author Alex Hall// @homepage https://www.devseo.co.uk// @namespace https://www.devseo.co.uk/blog/view/greasemonkey-script// @version 1.0// @description Locate specific domains easily within the results of a Google, Yahoo!, or Bing Search// @include https://www.google.com/search*// @include https://google.com/search*// @include https://www.google.com/#*// @include https://google.com/#*// @include https://www.google.co.uk/search*// @include https://google.co.uk/search*// @include https://www.google.co.uk/#*// @include https://google.co.uk/#*// @include https://uk.search.yahoo.com/search*// @include https://search.yahoo.com/*// @include https://bing.com/search*// @include https://www.bing.com/search*// ==/UserScript==//***********************BEGIN CONFIGURATION**********************//// Set the array of sites you wish to locate (without www is best) - syntax [['mydomain.com', '#color'], ['mydomain2.com', '#color']];// Set the color variable to the background color you wish to use to highlight your domain (defaults to light red)var sites = [ ['lifehacker.com', '#FFCC66'], ['gizmodo.com', '#C2D9EF'],];var siteLen = sites.length;var numNot = 0;//************************END CONFIGURATION***********************////*******************DO NOT EDIT PAST THIS LINE*******************////****************UNLESS YOU KNOW WHAT YOU'RE DOING***************//setTimeout(startItOff, 1000);function startItOff(){ var all_links = document.getElementsByTagName('a'); var linkLen = all_links.length; if (location.hostname.indexOf("google.com")!=-1) { for (i=0; i<linkLen; i++) { if (all_links[i].className!='l') { continue; } var href = all_links[i].getAttribute('href'); if(all_links[i].parentNode.tagName.toLowerCase() === 'h4'){ numNot++; } } for (i=0; i<linkLen; i++) { if (all_links[i].className!='l') { continue; } var href = all_links[i].getAttribute('href'); for(j=0;j<siteLen;j++){ if (href.indexOf(sites[j][0])==-1) { continue; } var result=all_links[i].parentNode.parentNode; result.style.backgroundColor=sites[j][1]; result.style.overflow='hidden'; result.style.width='740px'; var listingNum = all_links[i].getAttribute('onmousedown'); listingNum = listingNum.split(','); listingNum = listingNum[4].split('\''); listingNum = listingNum[1]; var resultDiv = document.createElement('div'); result.appendChild(resultDiv); resultDiv.style.cssText = 'float: right;font-size:16px;margin:0 5px 5px 0;background: #FFF;padding: 5px;'; resultDiv.innerHTML = 'Result ' + (listingNum - numNot); } } } else if (location.hostname.indexOf("google.co.uk")!=-1) { for (i=0; i<linkLen; i++) { if (all_links[i].className!='l') { continue; } var href = all_links[i].getAttribute('href'); if(all_links[i].parentNode.tagName.toLowerCase() === 'h4'){ numNot++; } } for (i=0; i<linkLen; i++) { if (all_links[i].className!='l') { continue; } var href = all_links[i].getAttribute('href'); for(j=0;j<siteLen;j++){ if (href.indexOf(sites[j][0])==-1) { continue; } var result=all_links[i].parentNode.parentNode; result.style.backgroundColor=sites[j][1]; result.style.overflow='hidden'; result.style.width='740px'; var listingNum = all_links[i].getAttribute('onmousedown'); listingNum = listingNum.split(','); listingNum = listingNum[4].split('\''); listingNum = listingNum[1]; var resultDiv = document.createElement('div'); result.appendChild(resultDiv); resultDiv.style.cssText = 'float: right;font-size:16px;margin:0 5px 5px 0;background: #FFF;padding: 5px;'; resultDiv.innerHTML = 'Result ' + (listingNum - numNot); } } } else if (location.hostname.indexOf("yahoo.com")!=-1) { for (i=0; i<linkLen; i++) { if (all_links[i].className!=('yschttl spt')) { continue; } var href = all_links[i].getAttribute('href'); for(j=0;j<siteLen;j++){ if (href.indexOf(sites[j][0])==-1) { continue; } var result=all_links[i].parentNode.parentNode.parentNode; result.style.backgroundColor=sites[j][1]; result.style.overflow='hidden'; result.style.clear = 'both'; } } } else if (location.hostname.indexOf("bing.com")!=-1) { var all_divs=document.getElementsByTagName('div'); for (i=0; i<linkLen; i++) { if (all_divs[i].className!='sb_tlst') { continue; } var link = all_divs[i].childNodes[0].childNodes[0]; var href=link.getAttribute('href'); for(j=0;j<siteLen;j++){ if (href.indexOf(sites[j][0])==-1) { continue; } var result=link.parentNode.parentNode.parentNode; result.style.backgroundColor=sites[j][1]; } } }}
サイトは好きなだけ追加でき、さまざまな色も好きなだけ追加できます。完了したら、テキスト ファイルを次の名前で保存します。.user.js
ファイルを選択し、ブラウザ ウィンドウにドラッグします (Firefox ユーザーはもちろん、グリースモンキーインストールする拡張機能)。スクリプトで指定した結果が Google によって強調表示されることがわかります。現時点では、このスクリプトは Google インスタントでは機能しないことに注意してください。オフにしてくださいスクリプトを機能させるために。また、このスクリプトは、Bing や Yahoo など、他の多くの検索エンジンでも機能することに注意してください。
Locate Multiple Domains は、Greasemonkey を備えた Firefox、Chrome、Opera、および SIMBL と Greasekit を備えた Safari で動作するユーザー スクリプトです。