Skip to content

Commit

Permalink
fix(browser-pool): respect user options before assigning fingerpints (#…
Browse files Browse the repository at this point in the history
…2190)

Closes #2164
  • Loading branch information
foxt451 committed Nov 27, 2023
1 parent d5aa254 commit f050776
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/browser-pool/src/fingerprinting/hooks.ts
Expand Up @@ -63,8 +63,8 @@ export function createPrePageCreateHook() {
const { fingerprint } = launchContext.fingerprint!;

if (launchContext.useIncognitoPages && browserPlugin instanceof PlaywrightPlugin && pageOptions) {
pageOptions.userAgent = fingerprint.navigator.userAgent;
pageOptions.viewport = {
pageOptions.userAgent ??= fingerprint.navigator.userAgent;
pageOptions.viewport ??= {
width: fingerprint.screen.width,
height: fingerprint.screen.height,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/browser-pool/src/utils.ts
Expand Up @@ -35,7 +35,7 @@ export type InferBrowserPluginArray<
// Return the results
? Result
// If the input is a general array of elements (not a tuple), infer it's values type
: Input extends (infer U)[]
: Input extends readonly (infer U)[]
// If the values are a union of the plugins
? [U] extends [PuppeteerPlugin | PlaywrightPlugin]
// Return an array of the union
Expand Down

0 comments on commit f050776

Please sign in to comment.