|
|
Supported
versions: Firefox 1.5 - 2.0.0.* ALL
Notes / Comments: The code behind this extension is nothing more than this:___// ==UserScript==// @name Wikipedia History// @author Christian Steinert// @description Adds a history box with the last 6 visited pages to Wikipedia and some other MediaWiki sites. Created with chickenfoot (http://groups.csail.mit.edu/uid/chickenfoot/)// @version 0.11// @guid e18a3c24-7779-3f78-b537-f257918d00c9// @include */wiki/*// @include */w*/index.php*// @include *wikipedia*// ==/UserScript==function hist() { var MAX_ENTRIES = 6; //maximum number of history entries var TITLE_TEXT = 'wiki history'; var WIKI_PATTERN = /wikipedia|/w.*/index.php|/wiki//; //URL pattern part for MediaWiki pages var item, prevTitle, itemCount=0, links=''; for( var i=history.length-2;i>=0; i-- ) { item = history[i]; if (itemCount==MAX_ENTRIES) break; if (!item.match(WIKI_PATTERN)) break; if (item.indexOf("action") > 0 || item.indexOf("Special:Userlogin") > 0 ) continue; var title = item.replace( /.*//,"" ).replace( /#.*/,"" ).replace( /_/g, " " ); if (title == prevTitle) continue; itemCount++; links+=''+title+''; prevTitle = title; } if( itemCount>0 ) insert(before(document.getElementById("p-search")), ''+TITLE_TEXT+''+links+'');}hist();___
Categories: Miscellaneous, Website Integration
Install: Wikipedia History

