@@ -25,7 +25,7 @@ use crate::metadata::{
25
25
} ;
26
26
use crate :: {
27
27
create_http_client, get_binary_extension, path_to_string, Logger , SeleniumManager , BETA ,
28
- DASH_DASH_VERSION , DEV , ENV_PROGRAM_FILES_X86 , NIGHTLY , OFFLINE_REQUEST_ERR_MSG ,
28
+ DASH_DASH_VERSION , DEV , ENV_PROGRAM_FILES_X86 , NIGHTLY , OFFLINE_REQUEST_ERR_MSG , REG_PV_ARG ,
29
29
REG_VERSION_ARG , STABLE ,
30
30
} ;
31
31
use anyhow:: Error ;
@@ -104,54 +104,79 @@ impl SeleniumManager for EdgeManager {
104
104
}
105
105
106
106
fn get_browser_path_map ( & self ) -> HashMap < BrowserPath , & str > {
107
- HashMap :: from ( [
108
- (
107
+ if self . is_webview2 ( ) {
108
+ HashMap :: from ( [ (
109
109
BrowserPath :: new ( WINDOWS , STABLE ) ,
110
- r#"Microsoft\Edge\Application\msedge.exe"# ,
111
- ) ,
112
- (
113
- BrowserPath :: new ( WINDOWS , BETA ) ,
114
- r#"Microsoft\Edge Beta\Application\msedge.exe"# ,
115
- ) ,
116
- (
117
- BrowserPath :: new ( WINDOWS , DEV ) ,
118
- r#"Microsoft\Edge Dev\Application\msedge.exe"# ,
119
- ) ,
120
- (
121
- BrowserPath :: new ( WINDOWS , NIGHTLY ) ,
122
- r#"Microsoft\Edge SxS\Application\msedge.exe"# ,
123
- ) ,
124
- (
125
- BrowserPath :: new ( MACOS , STABLE ) ,
126
- r#"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"# ,
127
- ) ,
128
- (
129
- BrowserPath :: new ( MACOS , BETA ) ,
130
- r#"/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta"# ,
131
- ) ,
132
- (
133
- BrowserPath :: new ( MACOS , DEV ) ,
134
- r#"/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev"# ,
135
- ) ,
136
- (
137
- BrowserPath :: new ( MACOS , NIGHTLY ) ,
138
- r#"/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary"# ,
139
- ) ,
140
- ( BrowserPath :: new ( LINUX , STABLE ) , "/usr/bin/microsoft-edge" ) ,
141
- (
142
- BrowserPath :: new ( LINUX , BETA ) ,
143
- "/usr/bin/microsoft-edge-beta" ,
144
- ) ,
145
- ( BrowserPath :: new ( LINUX , DEV ) , "/usr/bin/microsoft-edge-dev" ) ,
146
- ] )
110
+ r#"Microsoft\EdgeWebView\Application"# ,
111
+ ) ] )
112
+ } else {
113
+ HashMap :: from ( [
114
+ (
115
+ BrowserPath :: new ( WINDOWS , STABLE ) ,
116
+ r#"Microsoft\Edge\Application\msedge.exe"# ,
117
+ ) ,
118
+ (
119
+ BrowserPath :: new ( WINDOWS , BETA ) ,
120
+ r#"Microsoft\Edge Beta\Application\msedge.exe"# ,
121
+ ) ,
122
+ (
123
+ BrowserPath :: new ( WINDOWS , DEV ) ,
124
+ r#"Microsoft\Edge Dev\Application\msedge.exe"# ,
125
+ ) ,
126
+ (
127
+ BrowserPath :: new ( WINDOWS , NIGHTLY ) ,
128
+ r#"Microsoft\Edge SxS\Application\msedge.exe"# ,
129
+ ) ,
130
+ (
131
+ BrowserPath :: new ( MACOS , STABLE ) ,
132
+ r#"/Applications/Microsoft Edge.app/Contents/MacOS/Microsoft Edge"# ,
133
+ ) ,
134
+ (
135
+ BrowserPath :: new ( MACOS , BETA ) ,
136
+ r#"/Applications/Microsoft Edge Beta.app/Contents/MacOS/Microsoft Edge Beta"# ,
137
+ ) ,
138
+ (
139
+ BrowserPath :: new ( MACOS , DEV ) ,
140
+ r#"/Applications/Microsoft Edge Dev.app/Contents/MacOS/Microsoft Edge Dev"# ,
141
+ ) ,
142
+ (
143
+ BrowserPath :: new ( MACOS , NIGHTLY ) ,
144
+ r#"/Applications/Microsoft Edge Canary.app/Contents/MacOS/Microsoft Edge Canary"# ,
145
+ ) ,
146
+ ( BrowserPath :: new ( LINUX , STABLE ) , "/usr/bin/microsoft-edge" ) ,
147
+ (
148
+ BrowserPath :: new ( LINUX , BETA ) ,
149
+ "/usr/bin/microsoft-edge-beta" ,
150
+ ) ,
151
+ ( BrowserPath :: new ( LINUX , DEV ) , "/usr/bin/microsoft-edge-dev" ) ,
152
+ ] )
153
+ }
147
154
}
148
155
149
156
fn discover_browser_version ( & mut self ) -> Result < Option < String > , Error > {
150
- self . general_discover_browser_version (
151
- r#"HKCU\Software\Microsoft\Edge\BLBeacon"# ,
152
- REG_VERSION_ARG ,
153
- DASH_DASH_VERSION ,
154
- )
157
+ let ( reg_key, reg_version_arg, cmd_version_arg) = if self . is_webview2 ( ) {
158
+ let arch = self . get_arch ( ) ;
159
+ if X32 . is ( arch) {
160
+ (
161
+ r#"HKLM\SOFTWARE\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}"# ,
162
+ REG_PV_ARG ,
163
+ "" ,
164
+ )
165
+ } else {
166
+ (
167
+ r#"HKLM\SOFTWARE\WOW6432Node\Microsoft\EdgeUpdate\Clients\{F3017226-FE2A-4295-8BDF-00C3A9A7E4C5}"# ,
168
+ REG_PV_ARG ,
169
+ "" ,
170
+ )
171
+ }
172
+ } else {
173
+ (
174
+ r#"HKCU\Software\Microsoft\Edge\BLBeacon"# ,
175
+ REG_VERSION_ARG ,
176
+ DASH_DASH_VERSION ,
177
+ )
178
+ } ;
179
+ self . general_discover_browser_version ( reg_key, reg_version_arg, cmd_version_arg)
155
180
}
156
181
157
182
fn get_driver_name ( & self ) -> & str {
0 commit comments