// ==UserScript==
// @name Block Last Measure
// @author TarquinWJ 
// @namespace http://www.howtocreate.co.uk/ 
// @version 1.2.1
// @description  Blocks the "Last Measure" family of shock sites that
//			displays nasty images, plays audio, and spawns
//			endless numbers of popup windows. 
// @ujs:category general: enhancements
// @ujs:published 2005-11-10 00:32
// @ujs:modified 2005-11-10 00:32
// @ujs:documentation http://userjs.org/scripts/general/enhancements/block-last-measure 
// @ujs:download http://userjs.org/scripts/download/general/enhancements/lastmeasure.js
// ==/UserScript==


/* 
 * Please see
 * http://www.howtocreate.co.uk/operaStuff/userJavaScript.html#terms
 * for License and Terms of Use
 */

opera.addEventListener(
	'BeforeScript',
	function (e) {
		if( document.title.match(/lolastmeasure|gnaa|our lawyer has informed us that we need a warning/i) && ( e.element.text.substr(0,1000).match(/(clipboardData\.getData[\w\W]*document\.forms\[\s*.clip.\s*\])|find this offensive|spawncreate/i) || e.element.getAttribute('src').match(/lol.js/i) ) ) {
			e.preventDefault();
			location.href = 'javascript:\'<html><head><title>Abusive site<\/title><\/head><body bgcolor=\"#ddeeff\" text=\"#000000\"><h1 style=\"color:red;\">Last Measure Detected!<\/h1><p>BlockLastMeasure script has protected you from this abusive site. If you are certain you want to allow the site to load, disable User JavaScript, but see <a href=\"http://en.wikipedia.org/wiki/Last_measure\">Wikipedia</a> for more details first.<\/p><\/body><\/html>\'';
		}
	},
false);
