Skip to content

Commit

Permalink
limit cookie domains, #22 (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
bbilly1 committed May 11, 2024
1 parent c82e493 commit 0d58dda
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extension/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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));
}
}
}

Expand Down

0 comments on commit 0d58dda

Please sign in to comment.