From bf7afad490c23adb3ef74846148c90b0dec845fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=B0nan=C3=A7=20G=C3=BCm=C3=BC=C5=9F?= Date: Fri, 10 May 2024 12:31:34 +0300 Subject: [PATCH] Update async addCookies for JS examples --- examples/cookies.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/examples/cookies.js b/examples/cookies.js index 43c12ec87..45076fab8 100644 --- a/examples/cookies.js +++ b/examples/cookies.js @@ -32,7 +32,7 @@ export default async function () { const day = 60*60*24; const dayAfter = unixTimeSinceEpoch+day; const dayBefore = unixTimeSinceEpoch-day; - context.addCookies([ + await context.addCookies([ // this cookie expires at the end of the session { name: 'testcookie', @@ -82,25 +82,25 @@ export default async function () { }); // let's add more cookies to filter by urls. - context.addCookies([ + await context.addCookies([ { - name: 'foo', - value: '42', - sameSite: 'Strict', - url: 'http://foo.com' + name: "foo", + value: "42", + sameSite: "Strict", + url: "http://foo.com", }, { - name: 'bar', - value: '43', - sameSite: 'Lax', - url: 'https://bar.com' + name: "bar", + value: "43", + sameSite: "Lax", + url: "https://bar.com", }, { - name: 'baz', - value: '44', - sameSite: 'Lax', - url: 'https://baz.com' - } + name: "baz", + value: "44", + sameSite: "Lax", + url: "https://baz.com", + }, ]); cookies = await context.cookies("http://foo.com", "https://baz.com"); check(cookies.length, {