Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Add mock UA string #487

Merged
merged 1 commit into from
Feb 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/cli/src/utils/browserManagement/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
this.shouldLogDebug = shouldLogDebug;
}

debugLog(msg: any) {

Check warning on line 57 in packages/cli/src/utils/browserManagement/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
if (this.shouldLogDebug) {
console.log(msg);
}
Expand All @@ -80,6 +80,11 @@
throw new Error('Browser not intialized');
}
const sitePage = await this.browser.newPage();

await sitePage.setUserAgent(
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36'
);

sitePage.setViewport({
width: 1440,
height: 790,
Expand Down Expand Up @@ -235,7 +240,7 @@
}
const frameIdMapFromTree = new Map();
const frames = page.frames();
const frameCallback = (frame: any) => {

Check warning on line 243 in packages/cli/src/utils/browserManagement/index.ts

View workflow job for this annotation

GitHub Actions / Lint

Unexpected any. Specify a different type
const frameId = frame._id;
const _url = frame.url();
frameIdMapFromTree.set(frameId, _url);
Expand Down
Loading