Wasn't it always? If it doesn't work "anymore", when exactly did it?
1) Make a new userscript that runs on 'http://wiki.greasespot.net/Location_hack'
2) Copy the code at the end of that page and paste it into the new script
3) Append the following lines:
alert(window.getGlobalValue('wgServer'));
alert(window.getGlobalValue('wgPageName'));
alert(window.getGlobalValue('wgArticleId'));
I would expect the following:
1st alert: http://wiki.greasespot.net
2nd alert: Location_hack
3rd alert: 1551
However, I'm getting:
1st alert:
2nd alert: http://wiki.greasespot.net
3rd alert: Location_hack
That is, the alert are returning the value set in the previous invocation.
Putting the alerts into setTimeout doesn't help, so I think this is
not an timing issue or a problem between the GM scope and the page's.
In fact, all alerts but the first one are returning values, that is,
*before the script returns*.
Another way to see it could be that this is an issue in the way
Firefox evaluates things within a function scope. There is a recent
report about this kind of (apparent?) problem, see [1] and the
comments that ensue.
Finally, note that if you insert an alert('foo') just before the line
'location.href = ... ', then everything works fine. I cannot explain
this behaviour.
[1] http://nedbatchelder.com/blog/200812/internet_explorer_mystery_1376.html