Skip to content

Commit

Permalink
Merge pull request #452 from mozilla/spotify-login-loop
Browse files Browse the repository at this point in the history
Spotify Loop Fix
  • Loading branch information
groovecoder authored Jul 3, 2019
2 parents 65d2e6e + 16361dd commit 854f6a1
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 34 deletions.
45 changes: 13 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "contain-facebook",
"version": "1.9.2",
"version": "2.0.1",
"description": "Facebook Container isolates your Facebook activity from the rest of your web activity in order to prevent Facebook from tracking you outside of the Facebook website via third party cookies. ",
"main": "background.js",
"scripts": {
Expand Down
11 changes: 11 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,13 +276,23 @@ function isFacebookURL (url) {
return false;
}

// TODO: Consider users if accounts.spotify.com already in FBC
async function supportSiteSubdomainCheck (url) {
if (url === "accounts.spotify.com") {
await addDomainToFacebookContainer("https://www.spotify.com");
await addDomainToFacebookContainer("https://open.spotify.com");
}
return;
}

// TODO: refactor parsedUrl "up" so new URL doesn't have to be called so much
// TODO: refactor fbcStorage "up" so browser.storage.local.get doesn't have to be called so much
async function addDomainToFacebookContainer (url) {
const parsedUrl = new URL(url);
const fbcStorage = await browser.storage.local.get();
fbcStorage.domainsAddedToFacebookContainer.push(parsedUrl.host);
await browser.storage.local.set({"domainsAddedToFacebookContainer": fbcStorage.domainsAddedToFacebookContainer});
await supportSiteSubdomainCheck(parsedUrl.host);
}

async function removeDomainFromFacebookContainer (domain) {
Expand All @@ -292,6 +302,7 @@ async function removeDomainFromFacebookContainer (domain) {
await browser.storage.local.set({"domainsAddedToFacebookContainer": fbcStorage.domainsAddedToFacebookContainer});
}

// TODO: Add PSL Subdomain Check against current list
async function isAddedToFacebookContainer (url) {
const parsedUrl = new URL(url);
const fbcStorage = await browser.storage.local.get();
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "Facebook Container",
"version": "2.0",
"version": "2.0.1",

"default_locale": "en",

Expand Down

0 comments on commit 854f6a1

Please sign in to comment.