OK, given that info,

Mozilla Bug 332176 (broken since 2006) says
"If code is run through an eval() which defines functions, then those functions are called up in the debugger, such as at a breakpoint in a stack frame, the code reference is wrong. It will point to the file in which the eval took place, and the line number will be the line number of the eval, offset by the line position within the contents of the eval string."

However, in "greasemonkey.js", there's a reference to Mozilla bug 307984
(broken since 2005) "Bug 307984 - Line numbers in errors from evalInSandbox are incorrect." This seems to be roughly the same bug,
but for evalInSandbox.  There's code in "greasemonkey.js" which is
suppposed to be a workaround for this problem. But in this case,
that code doesn't get executed, because I'm getting a timeout alert,
not an exception thrown in the eval.

The error message says the script hung at line 506 or 511 of "greasemonkey.js". So how do I calculate the line number in my code?

greasemonkey.js has two calls to evalInSandbox:

62 Components.utils.evalInSandbox(...
482 Components.utils.evalInSandbox(...

So,

506-482 = 24
506-62 = 444

and thus I should look for an error in my script at lines 24 or 444?
Is that right?

(It can't be line 506 or 511; those are both comments.)

Do the "==UserScript==  " header lines used by Greasemonkey count?
Assuming they don't, line 24 is out; that's in the header.  Line 444
in my script is at least possible, but unlikely.  I'm probably
calculating this wrong.

If you want to try to reproduce this, the script is at

"http://www.sitetruth.com/experimental/searchrater/searchrater.user.js";.

If you visit a Google search page with this script enabled, you will get
SiteTruth ratings on each search result. If you visit a Google news page, Firefox will hang.

Most of the code in "searchrater" is the same as the code in our old
"AdRater" plug-in for Mozilla, which is a compiled Graeasemonkey script.
That's been running for years without problems.

This is very frustrating, especially since something in Greasemonkey
has been broken for at least five years.

(Incidentally, all this is part of a system to detect search spam
by flagging search results from less-legitimate businesses.)

                                        John Nagle

--
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.

Reply via email to