Click here to Skip to main content
15,881,757 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wrote a scripting program running by wscript.exe under DOS prompt to check whether a web page is completely loaded and then sendkeys to that page. The codes as below work fine for IE page but not mozilla page. Any suggested solution? Thanks.
VB
Dim oShell, oWSHShell, sTitle, wndw, bMatch
sHTMLTitle = "Test Web Page"
set oShell = createobject("shell.application")
set oWSHShell = createobject("Wscript.shell")

bMatch = false
do until bMatch = true
  for each wndw in oShell.windows
    if instr(lcase(typename(wndw.document)), "htmldocument") > 0 then
      sTitle = wndw.document.title
      if Instr(sTitle, sHTMLTitle)<> 0  then
        do until wndw.document.readyState = "complete"
        loop
        oWSHShell.sendkeys "123"
        bMatch = true
        exit for
      end if
    end if
  next
loop
Posted
Updated 13-Feb-11 22:45pm
v2
Comments
JF2015 14-Feb-11 4:46am    
Added code formatting.

1 solution

AFAIK, Mozilla doesn't have an automation interface like IE does. There is no common automation interface used by all browsers. So, any code you write to work with IE, like what you have hear, will only work with IE.

What does mean? There is no scriptable way for you determine if the page is loaded or not from outside the browser.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900