miinx wrote  (on 24.08.2006 05:54):

> I've got a section that looks for a Mozilla password prompt, & 
> automatically enters my master pw when required.  What seems to be 
> happening is that the problem web page opens & shuts 13 separate 
> "XPCOM:EventReceiver" windows as it is being rendered -- they would be 
> for the AJAX calls, I'm assuming.

May I suggest, that you use Autorun list instead of HookWinodwsEvents. 
HWE has more overhead compared to Autorun and increases CPU usage. I'd 
use HWE only sparingly.

Anyway, if you can't address a window because it uses generic class 
names or titles (DirOpus is a king here), I'd suggest you use 
Miscplugin. Define an entry with your caption list, the more specified 
the better.

Target:
c=XPCOM:EventWindow

Action1:
Script
If
(win.caption("autorun") eq "Prompt" and 
miscplugin.Is_TextInWin("autorun",?"Please enter your password*") > 0)

Action2 (more action textbox):
win.sendkeys(?"{to autorun}min1girl{en}")

You get the idea, just adapt it to your case. Note that the captions in 
Autorun lists are bound with OR, not AND. So you can't use:
c=XPCOM:EventWindow && "Prompt"
or alike as target, and that's why you move one of conditions into the 
action part. The rest is the magic of Miscplugin. Note if you don't use 
the exact title in Is_TextInWin, put * (asterisks) as necessary.



@Bruce: Would it be possible to get AND-binding in caption lists, like 
above? Say, c=MyClass&&MyTitle would check BOTH conditions, and 
c=MyClass\&\&Mytitle (c=MyClass?=&&=MyTitle) would search for a 
classname "MyClass&&MyTitle".




> However, one question, just trying to understand what happened -- does 
> having a wait() in the window hook script mean that, when it is 
> encountered, no other windows can be created/destroyed/etc until the 
> wait completes?
 >
> So, like, can the hook script fire multiple concurrent times for 
> separate window events that are all happening together?  Or does each 
> window event get queued up to be processed by the hook script?  or 
> something else?
> 
> And so, should I maybe not be using wait()s in my hook windows script?

As far as I've seen, PP runs HWE sequentially. IMO it's not a good idea 
to use wait's in HWE since especially Firefox does open lots lots of 
hidden windows and closes them. So if even more hooked events occur 
during the wait, PP may eventually run out of buffer and crash.

Of course, Bruce has definitive insight into it and has the final word.

HTH,
Cü


Attention: PowerPro's Web site has moved: http://www.ppro.org 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/power-pro/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to