All pastes #1044459 Raw Edit

js2

public javascript v1 · immutable
#1044459 ·published 2008-06-11 01:56 UTC
rendered paste body
function init(){	var containor;	var links;	var goodUrls;	var pages;	var page;	var pagesTab;	var newTab;	var initialized;	var win;	alert(window.getBrowser().selectedBrowser.contentDocument.location);	if (window.getBrowser().selectedBrowser.contentDocument.location.toString().match("ebaumsworld") === null)	{		alert("not ebaums!");		return;	}		containor = window.getBrowser().selectedBrowser.contentDocument;	links = containor.getElementsByTagName("a");	alert(links[1].tagName);	page = 1;	goodUrls = Array();	pages = Array();	pagesTab = gBrowser.selectedTab;	alert(pagesTab.contentDocument.location);	alert(pagesTab.contentDocument.location);	newTab = gBrowser.addTab("about:blank");		for (var i in links)	{		var url = i.href;		if (url.match("page="))		{			for (var k in pages)			{				if (k == url)				{					continue;				}				pages[url] = i;			}		}		if (url.match("pictures\/view") || url.match("video\/watch") || url.match("jokes\/read"))		{			for (var j in goodUrls)			{				if (j == url)				{					continue;				}				goodUrls[url] = i;			}		}	}	alert(goodUrls[0]);	//newTab.focus();	//newTab.selectedBrowser.contentDocument.location = goodUrls[0];}