This is an interesting point. Try the following:
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
On Thu, Dec 4, 2008 at 4:17 PM, eijk <[EMAIL PROTECTED]> wrote:
> For me, it worked before (i.e. under Firefox 2). Or put differently:
> You are saying, that the
> code at the end of
>
> http://wiki.greasespot.net/Location_hack
>
> for window.getGlobalValue() should never have worked?
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"greasemonkey-users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/greasemonkey-users?hl=en
-~----------~----~----~----~------~----~------~--~---