From 0d58ddaaa2215dc1040e93ede03d0c3904819993 Mon Sep 17 00:00:00 2001 From: Simon <35427372+bbilly1@users.noreply.github.com> Date: Sat, 11 May 2024 22:02:46 +0700 Subject: [PATCH] limit cookie domains, #22 (#38) --- extension/background.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extension/background.js b/extension/background.js index dc61604..5ec1506 100644 --- a/extension/background.js +++ b/extension/background.js @@ -208,6 +208,7 @@ function buildCookieLine(cookie) { async function sendCookies() { console.log('function sendCookies'); + const acceptableDomains = ['.youtube.com', 'youtube.com', 'www.youtube.com']; let cookieStores = await browserType.cookies.getAllCookieStores(); let cookieLines = [ @@ -223,7 +224,9 @@ async function sendCookies() { }); for (let j = 0; j < allCookiesStore.length; j++) { const cookie = allCookiesStore[j]; - cookieLines.push(buildCookieLine(cookie)); + if (acceptableDomains.includes(cookie.domain)) { + cookieLines.push(buildCookieLine(cookie)); + } } }