Skip to content

Commit

Permalink
add check for localhost in learningEnabled function
Browse files Browse the repository at this point in the history
  • Loading branch information
ablanathtanalba committed Oct 3, 2020
1 parent 45a12f9 commit 06fc1e9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/js/incognito.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function startListeners() {
chrome.tabs.onRemoved.addListener(onRemovedListener);
}

function learningEnabled(tab_id) {
function learningEnabled(tab_id, tab_host) {
if (badger.getSettings().getItem("learnInIncognito")) {
// treat all pages as if they're not incognito
return true;
Expand All @@ -35,6 +35,10 @@ function learningEnabled(tab_id) {
if (!tabs.hasOwnProperty(tab_id)) {
return false;
}
// if tab host is a localhost or any private domain, default to disabled
if (window.isPrivateDomain(tab_host)) {
return false;
}
// else, do not learn in incognito tabs
return !tabs[tab_id];
}
Expand Down

0 comments on commit 06fc1e9

Please sign in to comment.