Skip to content

fix api change in cdproto.network #18

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

Merged
merged 1 commit into from
Jun 11, 2019
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
8 changes: 4 additions & 4 deletions cookie/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func setcookies(host string, res *string, cookies ...string) chromedp.Tasks {
panic("length of cookies must be divisible by 2")
}
return chromedp.Tasks{
chromedp.ActionFunc(func(ctx context.Context, h cdp.Executor) error {
chromedp.ActionFunc(func(ctx context.Context) error {
// create cookie expiration
expr := cdp.TimeSinceEpoch(time.Now().Add(180 * 24 * time.Hour))
// add cookies to chrome
Expand All @@ -78,7 +78,7 @@ func setcookies(host string, res *string, cookies ...string) chromedp.Tasks {
WithExpires(&expr).
WithDomain("localhost").
WithHTTPOnly(true).
Do(ctx, h)
Do(ctx)
if err != nil {
return err
}
Expand All @@ -93,8 +93,8 @@ func setcookies(host string, res *string, cookies ...string) chromedp.Tasks {
// read the returned values
chromedp.Text(`#result`, res, chromedp.ByID, chromedp.NodeVisible),
// read network values
chromedp.ActionFunc(func(ctx context.Context, h cdp.Executor) error {
cookies, err := network.GetAllCookies().Do(ctx, h)
chromedp.ActionFunc(func(ctx context.Context) error {
cookies, err := network.GetAllCookies().Do(ctx)
if err != nil {
return err
}
Expand Down