Skip to content

Commit

Permalink
Merge pull request #95 from breadsanta/master
Browse files Browse the repository at this point in the history
Added an option to not override other containers (fixes #78)
  • Loading branch information
Perflyst authored Oct 1, 2020
2 parents 24d466e + 2d12d80 commit 0212c54
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
5 changes: 5 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ function shouldContainInto (url, tab) {

if (handleUrl) {
if (tab.cookieStoreId !== googleCookieStoreId) {
if (tab.cookieStoreId !== "firefox-default" && extensionSettings.dont_override_containers) {
// Tab is already in a container, the user doesn't want us to override containers
return false;
}

// Google-URL outside of Google Container Tab
// Should contain into Google Container
return googleCookieStoreId;
Expand Down
8 changes: 8 additions & 0 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ <h1>Settings</h1>
<em>(Means don't use Google Container on Google sites with a path of <code>/flights</code>.)</em>
</label>
</p>

<p>
<label>
<input type="checkbox" id="dont_override_containers" value="1">
Don't override other containers<br>
<em>(Means don't use Google Container on tabs that are already in a container.)</em>
</label>
</p>

<button type="submit">Save settings</button>

Expand Down
5 changes: 3 additions & 2 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ function onOptionsPageSave(e)
"ignore_youtube": document.querySelector("#ignore_youtube").checked,
"ignore_searchpages": document.querySelector("#ignore_searchpages").checked,
"ignore_maps": document.querySelector("#ignore_maps").checked,
"ignore_flights": document.querySelector("#ignore_flights").checked
"ignore_flights": document.querySelector("#ignore_flights").checked,
"dont_override_containers": document.querySelector("#dont_override_containers").checked
});

browser.runtime.reload();
Expand All @@ -22,7 +23,7 @@ function onOptionsPageLoaded()
document.querySelector("#ignore_youtube").checked = res.ignore_youtube || false;
document.querySelector("#ignore_searchpages").checked = res.ignore_searchpages || false;
document.querySelector("#ignore_maps").checked = res.ignore_maps || false;
document.querySelector("#ignore_flights").checked = res.ignore_flights || false;
document.querySelector("#dont_override_containers").checked = res.override_containers || false;
});
}

Expand Down

0 comments on commit 0212c54

Please sign in to comment.