Skip to content

Commit 68e144d

Browse files
committed
remove har options
1 parent ef6691d commit 68e144d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

playwright/src/main/java/com/microsoft/playwright/impl/BrowserTypeImpl.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,14 @@ private BrowserContextImpl launchPersistentContextImpl(Path userDataDir, LaunchP
158158
// Make a copy so that we can nullify some fields below.
159159
options = convertType(options, LaunchPersistentContextOptions.class);
160160
}
161+
162+
Browser.NewContextOptions harOptions = convertType(options, Browser.NewContextOptions.class);
163+
options.recordHarContent = null;
164+
options.recordHarMode = null;
165+
options.recordHarPath = null;
166+
options.recordHarOmitContent = null;
167+
options.recordHarUrlFilter = null;
168+
161169
options.timeout = TimeoutSettings.launchTimeout(options.timeout);
162170

163171
JsonObject params = gson().toJsonTree(options).getAsJsonObject();
@@ -203,7 +211,7 @@ private BrowserContextImpl launchPersistentContextImpl(Path userDataDir, LaunchP
203211
if (options.baseURL != null) {
204212
context.setBaseUrl(options.baseURL);
205213
}
206-
context.initializeHarFromOptions(convertType(options, Browser.NewContextOptions.class));
214+
context.initializeHarFromOptions(harOptions);
207215
context.tracing().setTracesDir(options.tracesDir);
208216
return context;
209217
}

0 commit comments

Comments
 (0)