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

Update cookies.js for use in latest versions of pptr #78 #79

Merged
merged 4 commits into from
Oct 8, 2022
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update cookies.js
  • Loading branch information
smashah authored Jun 24, 2022
commit 2bdf4b86613a4b023deae7352ce996c3c30e6c6c
4 changes: 2 additions & 2 deletions src/lib/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ const formatCookie = (cookie) => {
// Responsible for getting and setting browser cookies
class CookieHandler extends CDP {
constructor(request) {
super(request._client);
super(request._client || request.client);
this.url = request.isNavigationRequest() ? request.url() : request.frame().url();
this.domain = new URL(this.url).hostname;
}
Expand Down Expand Up @@ -111,4 +111,4 @@ class CookieHandler extends CDP {
}
}

module.exports = CookieHandler;
module.exports = CookieHandler;