Sign in to follow this  
Followers 0
Hasher

Capturing the submit event of a webpage and pausing

4 posts in this topic

#1 ·  Posted (edited)

HI

I have been playing www.roboform.com mostly for automating with Fire fox on thing it does I just love .When you submit a page a msgbox comes up which pauses any submit action , then once you respond the page continues..... how would make a page pause before continuing ?

I want to learn to do it to implement in my own programs .Suspecting that they do it by hooking the submit function in the DOM ? but how the pause ?

Looked at this http://developer.mozilla.org/en/docs/DOM:w...w.captureEvents

<html>
 &lt;script>
  function reg() {
   window.captureEvents(Event.CLICK);
   window.onclick = page_click;
  }

  function page_click() {
   alert('page click event detected!');
  }
 </script>

 <body onload="reg();">
 <p>click anywhere on this page.</p>
 </body>
</html>

But how do I attach to the 'Event' in Autoit or more likley IE.au3 ?

Thanks in Advance :">

Edited by Hasher

Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!

Share this post


Link to post
Share on other sites



Since no one has answered I thought I would try to expand further on what I am trying to do . Below is an image from Roboform ....Basically once I click the button the messagebox comes up prompting for the a response . Once it recieves a response the page continues to submit . What I want to do is pause the page like Roboform until I am ready to proceed.

http://img341.imageshack.us/my.php?image=untitledoj7.jpg


Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

You can use ObjEvent in AutoIt to register for events... unfortunately, this will not give you what you want because of the way that AutoIt COM handles COM events. AutoIt does not insert itself into the event processing stream like you can in script running in browser context, but rather it sets itself up to be notified of events. Because of this you cannot trap an event, pause the execution and take action in the middle of event processing - often, the event will already be fully resolved before you even hear about it in AutoIt.

You can however use IE.au3 _IEDocInsertHTML and _IEHeadInsertEventScript to write custom script back to the document that will allow you to do things like those in your evample... note however that the captureEvents method is unique to Netscape and is not available in IE -- there you would add, for example, an onsubmit event on the form in question to activate a function in the browser context taht would do what you wanted.

Dale

Edit: added clarity

Edited by DaleHohm

Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites

Thanks for you reply Dale, very insightful :-) Thought you would be the one to reply to this one . Cheers once again


Firefox's secret is the same as Jessica Simpson's: its effortless, glamorous style is the result of — shhh — extensions!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0