@@ -128,35 +128,35 @@ private void Load(IConfiguration configuration)
128128
129129 private BrowserNewContextOptions LoadContextOptions ( IConfiguration configuration ) => EnsureFoldersExist ( new BrowserNewContextOptions
130130 {
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 ) ) ,
134136 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 ) ) ) ,
137139 Locale = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . Locale ) ) ,
138140 ColorScheme = configuration . GetValue < ColorScheme ? > ( nameof ( BrowserNewContextOptions . ColorScheme ) ) ,
139141 AcceptDownloads = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . AcceptDownloads ) ) ,
140142 HasTouch = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . HasTouch ) ) ,
141- HttpCredentials = configuration . GetValue < Credentials > ( nameof ( BrowserNewContextOptions . HttpCredentials ) ) ,
143+ HttpCredentials = configuration . GetValue < HttpCredentials > ( nameof ( BrowserNewContextOptions . HttpCredentials ) ) ,
142144 DeviceScaleFactor = configuration . GetValue < float ? > ( nameof ( BrowserNewContextOptions . DeviceScaleFactor ) ) ,
143145 Offline = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . Offline ) ) ,
144146 IsMobile = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . IsMobile ) ) ,
145147
146148 // TODO: Map this properly
147- Permissions = configuration . GetValue < ContextPermission [ ] > ( nameof ( BrowserNewContextOptions . Permissions ) ) ,
149+ Permissions = configuration . GetValue < IEnumerable < string > > ( nameof ( BrowserNewContextOptions . Permissions ) ) ,
148150
149151 Geolocation = BindValue < Geolocation > ( configuration , nameof ( BrowserNewContextOptions . Geolocation ) ) ,
150152 TimezoneId = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . TimezoneId ) ) ,
151153 IgnoreHTTPSErrors = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . IgnoreHTTPSErrors ) ) ,
152154 JavaScriptEnabled = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . JavaScriptEnabled ) ) ,
153155 BypassCSP = configuration . GetValue < bool ? > ( nameof ( BrowserNewContextOptions . BypassCSP ) ) ,
154156 UserAgent = configuration . GetValue < string > ( nameof ( BrowserNewContextOptions . UserAgent ) ) ,
155- Viewport = BindValue < ViewportSize > ( configuration , nameof ( BrowserNewContextOptions . Viewport ) ) ,
157+ ViewportSize = BindValue < ViewportSize > ( configuration , nameof ( BrowserNewContextOptions . ViewportSize ) ) ,
156158 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 ) )
160160 } ) ;
161161
162162 private static T BindValue < T > ( IConfiguration configuration , string key ) where T : new ( )
@@ -356,5 +356,5 @@ private BrowserTypeLaunchOptions Combine(BrowserTypeLaunchOptions defaultOptions
356356 } ;
357357 }
358358
359- public record BrowserOptions ( BrowserKind BrowserKind , BrowserTypeLaunchOptions BrowserBrowserTypeLaunchOptions , BrowserNewContextOptions DefaultContextOptions ) ;
359+ public record BrowserOptions ( BrowserKind BrowserKind , BrowserTypeLaunchOptions BrowserLaunchOptions , BrowserNewContextOptions DefaultContextOptions ) ;
360360}
0 commit comments