[Greasemonkey] Intermediate web page
Jeremy Dunck
jdunck at gmail.com
Wed Feb 8 07:02:30 EST 2006
On 2/8/06, csaba2000 (sent by Nabble.com) <lists at nabble.com> wrote:
> current sudoku state (using GM_getValue), fill out the sudoku table on hint
> page, and then get the hint, which requires (simulating the) pressing (of) a
> button (method=POST) on the hint page to get a new hint result page.
Consider writing your GM_xhr to directly create the post on the hint
page, and scraping the hint out of the response text.
> 1. How do I clean up after a GM_xmlhttpRequest? After all,
> GM_xmlhttpRequest brings up a new DOM, and then I will be
No, it just creates a large string, which is dealt with the same way
as other variables (GC).
> 2. I assume GM_xmlhttpRequest is anychronous. In other words, the next
> line of code executes immediately. Therefore, I should immediately follow
> it with some kind of timing loop (window.setInterval) to check for the hint
> result page being finished.
It is async, but you can have your callback do the handling for the
hint post response.
> which doesn't strike me as very
> clean.
In the sense of coupling and reuse? Think of user scripts as shell
scripts, and you'll be closer to the spirit of the thing. Do what
works. ;-)
More information about the Greasemonkey
mailing list