From 8d13bdc6cac0e20c43c6f909fc0208774b9c5c84 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 21:47:39 +0200 Subject: Adding upstream version 2020.10.7. Signed-off-by: Daniel Baumann --- tests/selenium/website_testbed/first-party.html | 13 +++++++++++++ tests/selenium/website_testbed/first-party.js | 25 +++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 tests/selenium/website_testbed/first-party.html create mode 100644 tests/selenium/website_testbed/first-party.js (limited to 'tests/selenium/website_testbed') diff --git a/tests/selenium/website_testbed/first-party.html b/tests/selenium/website_testbed/first-party.html new file mode 100644 index 0000000..13713c4 --- /dev/null +++ b/tests/selenium/website_testbed/first-party.html @@ -0,0 +1,13 @@ + + + + + + +

Welcome to the cookie tracker test site. I'm creating a localcookie for this domain. +

+ +

I feel like iframing in a third party website:

+ + + diff --git a/tests/selenium/website_testbed/first-party.js b/tests/selenium/website_testbed/first-party.js new file mode 100644 index 0000000..7fdebe8 --- /dev/null +++ b/tests/selenium/website_testbed/first-party.js @@ -0,0 +1,25 @@ +function setExpire() { + var now = new Date(); + var time = now.getTime(); + var expireTime = time + 864000; + now.setTime(expireTime); + return ";expires=" + now.toGMTString(); +} + +function setPath() { + return ";path=/"; +} + +function setSameSite() { + return ";SameSite=None;Secure"; +} + +function updateCookie() { + var oldcookie = document.cookie; + var val = "1234567890"; + console.log("read cookie: " + oldcookie); + document.cookie = "localtest=" + encodeURIComponent(val) + setExpire() + setPath() + setSameSite(); + console.log("updating cookie to:" + document.cookie); +} + +updateCookie(); -- cgit v1.2.3