Skip to content

Commit

Permalink
Fix: set serviceWorkers default value
Browse files Browse the repository at this point in the history
In the implementation of adding the serviceWorkers option (microsoft#14714), the default value was not properly set.

This PR fixes the workaround needed here:
microsoft#15684 (comment)

As you can see, it is documented to default to `"allow"`:
https://github.com/rwoll/playwright/blob/main/docs/src/api/params.md#context-option-service-worker-policy

Signed-off-by: Oren <[email protected]>
  • Loading branch information
orenyomtov authored Jan 4, 2023
1 parent 711a1aa commit ff20538
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/playwright-core/src/client/browserContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ export async function prepareBrowserContextParams(options: BrowserContextOptions
noDefaultViewport: options.viewport === null,
extraHTTPHeaders: options.extraHTTPHeaders ? headersObjectToArray(options.extraHTTPHeaders) : undefined,
storageState: await prepareStorageState(options),
serviceWorkers: options.serviceWorkers,
serviceWorkers: options.serviceWorkers === null ? 'allow' : options.serviceWorkers,
recordHar: prepareRecordHarOptions(options.recordHar),
colorScheme: options.colorScheme === null ? 'no-override' : options.colorScheme,
reducedMotion: options.reducedMotion === null ? 'no-override' : options.reducedMotion,
Expand Down

0 comments on commit ff20538

Please sign in to comment.