Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
chaosharmonic committed Nov 25, 2024
1 parent ae9907f commit c28f914
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,12 +173,13 @@ export class Browser {
this.pages.push(page);

const celestial = page.unsafelyGetCelestialBindings();
const { userAgent: defaultUserAgent } = await celestial.Browser.getVersion();

const { userAgent: defaultUserAgent } = await celestial.Browser
.getVersion();

const {
// FIX: some type error here I haven't pinned down
userAgent = defaultUserAgent.replaceAll("Headless", "")
} = [ options, this.#options ].find(({ userAgent: ua }) => Boolean(ua))
userAgent = defaultUserAgent.replaceAll("Headless", ""),
} = [options, this.#options].find(({ userAgent: ua }) => Boolean(ua));

await Promise.all([
celestial.Emulation.setUserAgentOverride({ userAgent }),
Expand Down
2 changes: 1 addition & 1 deletion src/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export class Page extends EventTarget {
}

async setUserAgent(userAgent: string) {
await this.#celestial.Emulation.setUserAgentOverride({ userAgent })
await this.#celestial.Emulation.setUserAgentOverride({ userAgent });
}

// @ts-ignore see below
Expand Down

0 comments on commit c28f914

Please sign in to comment.