本帖最后由 风行者 于 2010-7-17 10:40 编辑
最终还是想到修改源码来达到不弹出新窗口,至少还是比较完美的,不会出现闪屏#include <IE.au3>
_IEErrorHandlerRegister()
Global $oIE = _IECreateEmbedded()
$url = "http://www.google.com.hk"
GUICreate("test", 700, 600, (@DesktopWidth - 700) / 2, (@DesktopHeight - 600) / 2)
GUICtrlCreateObj($oIE, 0, 0, 700, 600)
_IENavigate($oIE, $url)
_replace()
GUISetState()
Do
$nurl = _IEPropertyGet($oIE, "locationurl")
If $nurl <> $url Then
_replace()
$url = $nurl
EndIf
Sleep(10)
Until GUIGetMsg() = -3
Func _replace()
Local $body, $string
_IELoadWait($oIE)
$body = _IEBodyReadHTML($oIE)
$string = StringRegExpReplace($body, '\btarget=_blank', 'target=_self')
$string = StringRegExpReplace($string, '\btarget="_blank"', 'target=_self')
_IEBodyWriteHTML($oIE, $string)
EndFunc ;==>_replace
|