Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix timing issue in Cloudflare migration #2537

Merged
merged 1 commit into from
Jan 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions src/js/migrations.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,6 @@ exports.Migrations= {
},

forgetCloudflare: function (badger) {
console.log("Forgetting Cloudflare domains ...");

let actionMap = badger.storage.getBadgerStorageObject("action_map"),
actionClones = actionMap.getItemClones(),
snitchMap = badger.storage.getBadgerStorageObject("snitch_map"),
snitchClones = snitchMap.getItemClones(),
correctedSites = {};

let config = {
name: '__cfduid'
};
Expand All @@ -309,8 +301,15 @@ exports.Migrations= {
}

chrome.cookies.getAll(config, function (cookies) {
// assume there is no other tracking for these domains
let cfduidFirstParties = new Set();
console.log("Forgetting Cloudflare domains ...");

let actionMap = badger.storage.getBadgerStorageObject("action_map"),
actionClones = actionMap.getItemClones(),
snitchMap = badger.storage.getBadgerStorageObject("snitch_map"),
snitchClones = snitchMap.getItemClones(),
correctedSites = {},
// assume the tracking domains seen on these sites are all Cloudflare
cfduidFirstParties = new Set();

cookies.forEach(function (cookie) {
// get the base domain (also removes the leading dot)
Expand Down