-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexport-firefox-about-config.au3
More file actions
92 lines (71 loc) · 1.72 KB
/
export-firefox-about-config.au3
File metadata and controls
92 lines (71 loc) · 1.72 KB
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
;Create by Edwin(Erxin, Shang) 2015-11-28 for export Firefox about:config into plain text
#include <MsgBoxConstants.au3>
#include <FileConstants.au3>
#include <File.au3>
$firefox_path = $CmdLine[1]
$wait_ms = 500
$wait_timeout = 3000
$max_length = 65536
$output_path = $CmdLine[2]
;start firefox for the specify version
Run($firefox_path & " -P -no-remote")
;create a default user profile
WinWaitActive("Firefox - Choose User Profile")
sk("!c")
sk("!n")
sk("{ENTER}")
sk("{TAB 6}")
sk("{ENTER}")
WinWait("[CLASS:MozillaWindowClass]")
WinWaitActive("Default Browser")
WinActivate("Default Browser") ;dismiss the default browser dialog
sk("{ESC}")
sk("{F6}") ;navigate to about:config
Send("about:config")
sk("{ENTER}")
sk("{ENTER}")
;Select the first item
sk("{TAB}")
sk("{SPACE}")
mm("Before create output file")
Local $output_file = FileOpen($output_path, $FO_OVERWRITE)
If $output_file = 0 Then
mm("Create output file " & $output_path & " failed!")
Exit
EndIf
mm("After create output file")
mm("Before get item")
Local $ary[$max_length + 1]
$cur = 0
For $i = 0 To $max_length Step 1
$ary[$i] = copy_item()
$cur = $i
If $i = 0 Then
mm($ary[$i])
EndIf
If $i > 0 And $ary[$i-1] == $ary[$i] Then
ExitLoop
EndIf
Next
mm("after get item")
mm("before write output $cur = " & $cur)
For $i = 0 To $cur - 1 Step 1
mm($ary[$i])
FileWriteLine($output_file, $ary[$i])
Next
FileClose($output_file)
mm("Done")
Func mm($msg)
;MsgBox($MB_OK, "info", $msg)
EndFunc
Func copy_item()
Send("^c")
Sleep(100)
Send("{DOWN}")
Sleep(100)
Return ClipGet()
EndFunc
Func sk($msg)
Send($msg)
Sleep($wait_ms)
EndFunc