// VIFF.org Clean Links// version 0.2// 2006-10-02// Copyright (c) 2006, Pinder Johal//// --------------------------------------------------------------------//// This is a Greasemonkey user script.  To install it, you need// Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/// Then restart Firefox and revisit this script.// Under Tools, there will be a new menu item to "Install User Script".// Accept the default configuration and install.//// To uninstall, go to Tools/Manage User Scripts,// select "VIFF.org Clean Links", and click Uninstall.//// --------------------------------------------------------------------//// ==UserScript==// @name          VIFF.org Clean Links// @namespace     http://www.deftone.com/greasemonkey/// @description   Rewrites javascript film URLs to static URLs so individual films can be bookmarked// @include       http://viff.org/*// @include       http://www.viff.org/*// ==/UserScript==(function() {	var xpath = "//a[starts-with(@href,'javascript:phpEventNotePopup')]";	var res = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);	var i, link;	for (i = 0; link = res.snapshotItem(i); i++) {		link.href = link.href.replace(			/^javascript:phpEventNotePopup\('(.*)'\)/,			"eventnote.php?EventNumber=$1"		);	}		xpath = "//a[starts-with(@href,'javascript: phpEventNotePopup')]";	res = document.evaluate(xpath, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);	for (i = 0; link = res.snapshotItem(i); i++) {				link.href = link.href.replace(			/^javascript: phpEventNotePopup\('(.*)'\)/,			"eventnote.php?EventNumber=$1"		);	}})();
