Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Firefox WSS
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.
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 13-Feb-11 23:35pm
QQ Boy101
Edited 13-Feb-11 23:45pm
JF201553.3K
v2
Comments
JF2015 at 14-Feb-11 4:46am
   
Added code formatting.

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
0 OriginalGriff 325
1 DamithSL 300
2 Sergey Alexandrovich Kryukov 289
3 CPallini 235
4 Maciej Los 215
0 OriginalGriff 5,455
1 DamithSL 4,422
2 Maciej Los 3,860
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,010


Advertise | Privacy | Mobile
Web04 | 2.8.141216.1 | Last Updated 15 Feb 2011
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100