Stops working when session disappears from link address

in
Subscribe to Stops working when session disappears from link address 1 post, 1 voice

ChrisMatters User
OperaWindows

With new Ogame changes i see that session section of address isn't always displayed.
I don't know about other browsers but opera fail to execute this script while this happens.

If it helps I made few changes, so script works again.

1.
try
{
var session = "&session=" + document.location.href.match (/&session=([a-z0-9]{12})/) [1];
}
catch(err)
{
var session = '';
}

2.
if (links [j].getAttribute ("href").match ("page=" + page) != null)

3.
a.setAttribute ("href", "index.php?page=networkkommunikation" + session);

4.
a.setAttribute ("href", "index.php?page=globalTechtree" + session);

I'm not expert at this so it might look a little crude but maybe it will help as reference...

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