-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathclass_iexplorerClass.ahk
62 lines (56 loc) · 961 Bytes
/
class_iexplorerClass.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
class IExplorerClass
{
__new(iExplorer)
{
this.comObj := iExplorer
iExplorer.visible := true
return this
}
activateWindow()
{
windowName := this.comObj.LocationName
WinActivate, % windowName
return this
}
navigate(url)
{
this.comObj.navigate(url)
While(this.comObj.readyState != 4)
{
sleep 50
}
return this
}
waitFor(name)
{
while true
{
url := this.comObj.Document.title
IfInString, url, % name
{
break
}
debug("Waiting for location: " name "`nSeeing: " url)
sleep 500
}
debug("")
return this
}
waitForFullLoad()
{
While(this.comObj.document.readyState != "complete" || this.comObj.busy)
{
notify(this.comObj.readyState "`n" this.comObj.document.readyState)
Sleep, 50
}
return this
}
getElementById(id)
{
return this.comObj.document.getElementById(id)
}
getElementsByClassName(name)
{
return this.comObj.document.getElementsByClassName(name)
}
}