Perl programmer for hire: download my resume (PDF).
John Bokma Greasemonkey
freelance Perl programmer

Google Unsafe Sites early warning

Stop malicious programs getting on your computer | 0 comments

Since January 2006, Google warns about unsafe sites if you click on a link in the search results. Since I preferred an earlier warning as in: before I click, I wrote a small GreaseMonkey script. If you use Mozilla Firefox as your browser, and have the GreaseMonkey extension installed, you can use this small script as well.

First, create an empty file google-badware.user.js and open it in an editor. Copy and paste the code below into the file, change 'www.google.com' to your preferred Google location (twice), and save the edited file.

// ==UserScript==
// @name        Google BadWare
// @namespace   http://johnbokma.com/firefox/greasemonkey/
// @description Highlights link(s) that are considered badware
// @include     http://www.google.com/*
// @exclude
// ==/UserScript==

var links = document.getElementsByTagName( 'a' );
var element;

for ( var i = 0; i < links.length; i++ ) {

    element = links[ i ];

    if ( element.href.indexOf( "http://www.google.com/interstitial?url=" ) == 0 ) {

        element.style.color = "#ffffff";
        element.style.backgroundColor = "#ff0000";
    }
}

Drag and drop the JavaScript file you created into the Mozilla Firefox main window. Just above the contents a bar is displayed with the following text: "Greetings, fellow traveler. This is a Greasemonkey User Script. Click Install to start using it". Press the install button to the right of this message.

Test queries: 'serial crackz warez' or 'seriall.com' (without the quotes).

Please post a comment | read 0 comments | RSS feed