Jump to content

Recommended Posts

Posted

Using IE V11.592.18362.0 and IE document.parentWindow.pageYOffset fails.

Searched and found mLipok's script 

and ran it and still looks like broken.  Has anyone found a fix/workaround for getting pageYOffset?

Posted

That should work, but for strange reason, it had worked in the past, but not now :

#include <IE.au3>

Local $sHTML = '<HTML><Head><script language="javascript" type="text/javascript">'
$sHTML &= "var total = window.pageYOffset;" & @CRLF
$sHTML &= "alert (xEval());" & @CRLF
$sHTML &= "function xEval () {return total;}"
$sHTML &= "</script></Head></HTML>"

Local $oIE = _IECreate("about:blank")

_IEDocWriteHTML($oIE, $sHTML)
_IEAction($oIE, "refresh")

Local $Total = $oIE.document.xEval()
MsgBox (0,"",$Total)

idk, what is the problem.  I cannot have access to any created vars or functions.

Posted

Thanks - I guess I'm stuck.  Maybe it's time for me to look at FireFox - do you happen to know if there is an equivalent window.pageYOffset that works?

Posted (edited)

I was able to make it work with embedded IE like this :

#include <GUIConstantsEx.au3>
#include <IE.au3>
#include <WindowsConstants.au3>
#include <Process.au3>

Local $regValue = "0x2AF8"
RegWrite("HKCU\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_BROWSER_EMULATION", _ProcessGetName(@AutoItPID), "REG_DWORD", $regValue)

Local $oIE = _IECreateEmbedded ()
GUICreate("Embedded Web control Test", 640, 580, _
        (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, _
        $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN)
GUICtrlCreateObj($oIE, 10, 40, 600, 360)

GUISetState(@SW_SHOW)

_IENavigate ($oIE, "http://www.geom.uiuc.edu/~huberty/math5337/groupe/digits.html")
$oIE.document.parentWindow.scrollBy(0, 200)

Local $iYOff = $oIE.document.parentwindow.pageYOffset
MsgBox ($MB_SYSTEMMODAL,"",$iYOff)

While 1
  Switch GUIGetMsg ()
    Case $GUI_EVENT_CLOSE
      ExitLoop
  EndSwitch
WEnd

But I am still not able to make it work with "InternetExplorer.Application" object.

Edited by Nine

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...