Skip to content

Commit

Permalink
Last fix for #44; default value for undefined variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ysard committed Nov 11, 2018
1 parent b278a21 commit 2aec173
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,8 @@ vAPI.get_all_cookies = function(storeIds) {
// because it is less complex and removes much more items
let filtered_cookies = [];
if (vAPI.query_domain == "") {
// vAPI.query_domain is empty: get_all_cookies() is called from background script
// in case of deletion on boot or there is no domain searched.
filtered_cookies = cookies;
} else {
for (let cookie of cookies) {
Expand All @@ -235,6 +237,7 @@ vAPI.get_all_cookies = function(storeIds) {
} else
reject("all_cookies-NoCookies");
})
.catch(err => console.error(err));
});
}

Expand Down Expand Up @@ -740,7 +743,7 @@ vAPI.date_format = "DD-MM-YYYY HH:mm:ss";
vAPI.optimal_window_width = 1095;
vAPI.optimal_window_height = 585;

vAPI.query_domain;
vAPI.query_domain = "";
vAPI.query_names;
vAPI.query_values;

Expand Down
6 changes: 2 additions & 4 deletions src/background-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ function init_options() {
delete_all_on_restart: false,
});
get_settings.then((items) => {
console.log({storage_data: items});

// Load protected_cookies
protected_cookies = vAPI.get_and_patch_protected_cookies(items);

Expand All @@ -59,8 +57,8 @@ function init_options() {
if (items.delete_all_on_restart)
setTimeout(function() {
vAPI.get_stores().then((stores) => {
let deletion_promise = vAPI.delete_cookies(vAPI.get_all_cookies());
deletion_promise.then(null, vAPI.onError);
vAPI.delete_cookies(vAPI.get_all_cookies())
.catch(vAPI.onError);
});
}, 2000);
});
Expand Down

0 comments on commit 2aec173

Please sign in to comment.