@@ -128,35 +128,35 @@ private void Load(IConfiguration configuration)
128
128
129
129
private BrowserNewContextOptions LoadContextOptions ( IConfiguration configuration ) => EnsureFoldersExist ( new BrowserNewContextOptions
130
130
{
131
- Proxy = BindValue < ProxySettings > ( configuration , nameof ( BrowserNewContextOptions . Proxy ) ) ,
132
- RecordVideo = BindValue < RecordVideoOptions > ( configuration , nameof ( BrowserNewContextOptions . RecordVideo ) ) ,
133
- RecordHar = BindValue < RecordHarOptions > ( configuration , nameof ( BrowserNewContextOptions . RecordHar ) ) ,
131
+ Proxy = BindValue < Proxy > ( configuration , nameof ( BrowserNewContextOptions . Proxy ) ) ,
132
+ RecordVideoDir = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . RecordVideoDir ) ) ,
133
+ RecordVideoSize = BindValue < RecordVideoSize > ( configuration , nameof ( BrowserNewContextOptions . RecordVideoSize ) ) ,
134
+ RecordHarPath = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . RecordHarPath ) ) ,
135
+ RecordHarOmitContent = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . RecordHarOmitContent ) ) ,
134
136
ExtraHTTPHeaders = BindMultiValueMap (
135
- configuration . GetSection ( nameof ( BrowserNewContextOptions . ExtraHTTPHeaders ) ) ,
136
- argsMap => argsMap . ToDictionary ( kvp => kvp . Key , kvp => string . Join ( ", " , kvp . Value ) ) ) ,
137
+ configuration . GetSection ( nameof ( BrowserNewContextOptions . ExtraHTTPHeaders ) ) ,
138
+ argsMap => argsMap . ToDictionary ( kvp => kvp . Key , kvp => string . Join ( ", " , kvp . Value ) ) ) ,
137
139
Locale = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . Locale ) ) ,
138
140
ColorScheme = configuration . GetValue < ColorScheme ? > ( nameof ( BrowserNewContextOptions . ColorScheme ) ) ,
139
141
AcceptDownloads = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . AcceptDownloads ) ) ,
140
142
HasTouch = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . HasTouch ) ) ,
141
- HttpCredentials = configuration . GetValue < Credentials > ( nameof ( BrowserNewContextOptions . HttpCredentials ) ) ,
143
+ HttpCredentials = configuration . GetValue < HttpCredentials > ( nameof ( BrowserNewContextOptions . HttpCredentials ) ) ,
142
144
DeviceScaleFactor = configuration . GetValue < float ? > ( nameof ( BrowserNewContextOptions . DeviceScaleFactor ) ) ,
143
145
Offline = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . Offline ) ) ,
144
146
IsMobile = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . IsMobile ) ) ,
145
147
146
148
// TODO: Map this properly
147
- Permissions = configuration . GetValue < ContextPermission [ ] > ( nameof ( BrowserNewContextOptions . Permissions ) ) ,
149
+ Permissions = configuration . GetValue < IEnumerable < string > > ( nameof ( BrowserNewContextOptions . Permissions ) ) ,
148
150
149
151
Geolocation = BindValue < Geolocation > ( configuration , nameof ( BrowserNewContextOptions . Geolocation ) ) ,
150
152
TimezoneId = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . TimezoneId ) ) ,
151
153
IgnoreHTTPSErrors = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . IgnoreHTTPSErrors ) ) ,
152
154
JavaScriptEnabled = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . JavaScriptEnabled ) ) ,
153
155
BypassCSP = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . BypassCSP ) ) ,
154
156
UserAgent = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . UserAgent ) ) ,
155
- Viewport = BindValue < ViewportSize > ( configuration , nameof ( BrowserNewContextOptions . Viewport ) ) ,
157
+ ViewportSize = BindValue < ViewportSize > ( configuration , nameof ( BrowserNewContextOptions . ViewportSize ) ) ,
156
158
StorageStatePath = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . StorageStatePath ) ) ,
157
-
158
- // TODO: Map this properly
159
- StorageState = BindValue < StorageState > ( configuration , nameof ( BrowserNewContextOptions . StorageState ) )
159
+ StorageState = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . StorageState ) )
160
160
} ) ;
161
161
162
162
private static T BindValue < T > ( IConfiguration configuration , string key ) where T : new ( )
@@ -356,5 +356,5 @@ private BrowserTypeLaunchOptions Combine(BrowserTypeLaunchOptions defaultOptions
356
356
} ;
357
357
}
358
358
359
- public record BrowserOptions ( BrowserKind BrowserKind , BrowserTypeLaunchOptions BrowserBrowserTypeLaunchOptions , BrowserNewContextOptions DefaultContextOptions ) ;
359
+ public record BrowserOptions ( BrowserKind BrowserKind , BrowserTypeLaunchOptions BrowserLaunchOptions , BrowserNewContextOptions DefaultContextOptions ) ;
360
360
}
0 commit comments