OGame Redesign: Show Statistics Differences

By Vess Last update Oct 1, 2009 — Installed 7,466 times.

Internet Explorer

in
Subscribe to Internet Explorer 4 posts, 2 voices



Black Cat Scriptwright
FirefoxX11

DOMNodeInserted event isn't supported by IE (http://en.wikipedia.org/wiki/DOM_events)

I use setInterval to check in regular intervals and see if the node was inserted (http://userscripts.org/scripts/review/50678)

 
Vess Script's Author
FirefoxWindows

Even if I do

(function ()
{
	// The following "if" is not really necessary but with it this script will work for Opera too
	if (document.location.href.indexOf ('/game/index.php?page=statistics') == -1)
		return;
	function showStatDiffs ()
	{
		if (document.getElementById ("send") == null)
			return;
		var allStats = document.evaluate ('//*[@class="overmark" or @class="undermark"]', document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
		for (var i = 0; i < allStats.snapshotLength; i++)
			allStats.snapshotItem (i).firstChild.nodeValue = allStats.snapshotItem (i).getAttribute ("title");
		clearInterval (intervalName);
	}
	var intervalName = setInterval (showStatDiffs, 1000);
}
)();

it still doesn't work in IE+IE7Pro. :( Does IE support XPath at all?

 
Black Cat Scriptwright
FirefoxX11

IE doesn't support XPath
To use XPath you can install this script: http://iescripts.org/view-scripts-217p1.htm
I advice you not to use it because it will be very slow ;)

I see that you clear the timer using clearInterval
Try to see fleet statistics it won't work, because the whole page isn't loaded (the script doesn't run again), only the content of "#statisticsContent" is changed

 
Vess Script's Author
FirefoxWindows

Fixed now. :)

Cross
Presentational HTML allowed.
Use <code> for inline code and <pre> for code blocks. Use &lt; and &gt; for literal < and >.
We help break paragraphs and link your links.
or cancel