Making It Your Web

Greasemonkey Script to Locate Multiple Domains in Search Results

  • Posted 18th Aug 2009 @ 13:21:23
  • Last update 24th May 2013 @ 18:01:35
  • By Alex Hall

Greasemonkey is a Firefox Add-on that can be used to install custom scripts that run on specific pages on the internet when the page loads. This can be a very useful tool for many things such as highlighting elements, hiding elements and adding custom functionality to pages that weren't previously available.

One useful tool I have seen is written by Mark Stoecker actually highlights listing on a search results page from the big three search engines (Google, Yahoo! and Bing) based on the domain you ask it to show.

The biggest flaw with this script is that you can only manage one domain at a time so you'd either have to install multiple scripts for each domain, or change the script each time you searched for a separate domain.

I decided to write an addition to this extension, which allows for multiple domains and for each domain you can select a different colour to highlight so that you can differentiate between which domain you are referring to on a single page by the different colours of their backgrounds.

The syntax for setting up your domains is:

var sites = [['', '#FCC'], ['', '#F00']];

Basically, for each site you have list the domain name of the site, and then the colour in exactly the same way that this one has been done for two domains. Each one must be surrounded by square braces (']' and ']') and the whole list must also be surrounded by square braces.

Once all that has been edited all you need to do is install the script into Greasemonkey and run it in a search.

Multiple Domain Highlights in Search Engine

Any questions/bug reports/fixes/update you need or see please let me know in the comments to this blog, or you can find my script on where you can leave feedback and bug reports.

Otherwise, enjoy the script! If you have Greasemonkey already installed click here otherwise the source can be found here. I would like to thank Lee Johnson for notifying me of the script and asking me to write it for him!

Update: If you would like an enhanced (beta) version of the script you can download it here or find the source here and just copy the source over what you already have (but don't forget to re-update your domains!). This update shows you the listing number in Google (or what position the domain appears in. Keep checking back for updates as this script is now a constant work in progress!

Once again, let me know if there are any issues.

Comments (2)

Shenika Membrano by Shenika

on 28th Jun 2013 @ 09:59:50

I love Greasemonkey Script....

0 1


Thanks! by Alex Hall (author)

on 2nd Jul 2013 @ 08:29:37

Thanks for that Shenika. Please feel free to let me know how you use it and whether you think it requires an update at all!

0 0


Add A Comment

Please note: all comments are moderated before they are published on this page.

Cancel Reply