Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

Fix "TypeError: Cannot read property 'slice' of undefined" when using setCookies API #201

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 1 addition & 9 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,7 @@ export async function setCookies(
const { Network } = client

for (const cookie of cookies) {
await Network.setCookie({
...cookie,
url: getUrlFromCookie(cookie),
})
await Network.setCookie(cookie)
}
}

Expand Down Expand Up @@ -397,11 +394,6 @@ export async function mouseup(client: Client, selector: string, scale: number) {
})
}

function getUrlFromCookie(cookie: Cookie) {
const domain = cookie.domain.slice(1, cookie.domain.length)
return `https://${domain}`
}

export async function deleteCookie(
client: Client,
name: string,
Expand Down