Skip to content
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.

Commit

Permalink
Add missing default values in background.js (#20044)
Browse files Browse the repository at this point in the history
* Add missing default for the applied_rulesets

* Update background.js

* Update background.js

* Update background.js
  • Loading branch information
cschanaj authored Apr 15, 2021
1 parent acff1ec commit 052d9fd
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions chromium/background-scripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ function initializeStoredGlobals() {
});
}

let upgradeToSecureAvailable;
/** @type {boolean} */
let upgradeToSecureAvailable = false;

function getUpgradeToSecureAvailable() {
if (typeof browser !== 'undefined') {
Expand Down Expand Up @@ -276,7 +277,7 @@ BrowserSession.prototype = {

// sort by ruleset names alphabetically, case-insensitive
if (this.getTab(tabId, "applied_rulesets", null)) {
let rulesets = this.getTab(tabId, "applied_rulesets");
let rulesets = this.getTab(tabId, "applied_rulesets", null);
let insertIndex = 0;

const ruleset_name = ruleset.name.toLowerCase();
Expand Down Expand Up @@ -407,7 +408,7 @@ function onBeforeRequest(details) {
return redirectOnCancel(shouldCancel, details.url);
}

if (browserSession.getRequest(details.requestId, "redirect_count") >= 8) {
if (browserSession.getRequest(details.requestId, "redirect_count", 0) >= 8) {
util.log(util.NOTE, "Redirect counter hit for " + uri.href);
urlBlacklist.add(uri.href);
rules.settings.domainBlacklist.add(uri.hostname);
Expand Down

0 comments on commit 052d9fd

Please sign in to comment.