Skip to content

Commit

Permalink
Remove option to block about:config
Browse files Browse the repository at this point in the history
  • Loading branch information
proginosko committed Nov 26, 2017
1 parent d7aa88b commit b49b5ca
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,14 +201,14 @@ function checkTab(id, url, isRepeat) {
let allowRE = gOptions[`allowRE${set}`];
let keywordRE = gOptions[`keywordRE${set}`];

// Get options for preventing access to about:addons and about:config
// Get options for preventing access to about:addons and about:support
let prevAddons = gOptions[`prevAddons${set}`];
let prevConfig = gOptions[`prevConfig${set}`];
let prevSupport = gOptions[`prevSupport${set}`];

// Test URL against block/allow regular expressions
if (testURL(pageURL, blockRE, allowRE)
|| (prevAddons && /^about:addons/i.test(pageURL))
|| (prevConfig && /^about:(config|support)/i.test(pageURL))) {
|| (prevSupport && /^about:support/i.test(pageURL))) {
// Get options for this set
let timedata = gOptions[`timedata${set}`];
let times = gOptions[`times${set}`];
Expand Down
4 changes: 2 additions & 2 deletions common.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ function cleanOptions(options) {
if (typeof options[`prevAddons${set}`] !== "boolean") {
options[`prevAddons${set}`] = false;
}
if (typeof options[`prevConfig${set}`] !== "boolean") {
options[`prevConfig${set}`] = false;
if (typeof options[`prevSupport${set}`] !== "boolean") {
options[`prevSupport${set}`] = false;
}
if (typeof options[`blockRE${set}`] !== "string") {
options[`blockRE${set}`] = "";
Expand Down
4 changes: 2 additions & 2 deletions options.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@
<label for="prevAddons1">Prevent access to about:addons at times when these sites are blocked</label>
</p>
<p>
<input id="prevConfig1" type="checkbox">
<label for="prevConfig1">Prevent access to about:config and about:support at times when these sites are blocked</label>
<input id="prevSupport1" type="checkbox">
<label for="prevSupport1">Prevent access to about:support at times when these sites are blocked</label>
</p>
<hr>
<p>
Expand Down
22 changes: 11 additions & 11 deletions options.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function saveOptions() {
let delaySecs = document.querySelector(`#delaySecs${set}`).value;
let prevOpts = document.querySelector(`#prevOpts${set}`).checked;
let prevAddons = document.querySelector(`#prevAddons${set}`).checked;
let prevConfig = document.querySelector(`#prevConfig${set}`).checked;
let prevSupport = document.querySelector(`#prevSupport${set}`).checked;

// Get regular expressions to match sites
let regexps = getRegExpSites(sites);
Expand All @@ -99,7 +99,7 @@ function saveOptions() {
options[`delaySecs${set}`] = delaySecs;
options[`prevOpts${set}`] = prevOpts;
options[`prevAddons${set}`] = prevAddons;
options[`prevConfig${set}`] = prevConfig;
options[`prevSupport${set}`] = prevSupport;
options[`blockRE${set}`] = regexps.block;
options[`allowRE${set}`] = regexps.allow;
options[`keywordRE${set}`] = regexps.keyword;
Expand Down Expand Up @@ -228,7 +228,7 @@ function retrieveOptions() {
let delaySecs = options[`delaySecs${set}`];
let prevOpts = options[`prevOpts${set}`];
let prevAddons = options[`prevAddons${set}`];
let prevConfig = options[`prevConfig${set}`];
let prevSupport = options[`prevSupport${set}`];

// Apply custom set name to tab (if specified)
if (setName) {
Expand All @@ -254,7 +254,7 @@ function retrieveOptions() {
document.querySelector(`#delaySecs${set}`).value = delaySecs;
document.querySelector(`#prevOpts${set}`).checked = prevOpts;
document.querySelector(`#prevAddons${set}`).checked = prevAddons;
document.querySelector(`#prevConfig${set}`).checked = prevConfig;
document.querySelector(`#prevSupport${set}`).checked = prevSupport;
}

// General options
Expand Down Expand Up @@ -349,7 +349,7 @@ function exportOptions() {
let delaySecs = document.querySelector(`#delaySecs${set}`).value;
let prevOpts = document.querySelector(`#prevOpts${set}`).checked;
let prevAddons = document.querySelector(`#prevAddons${set}`).checked;
let prevConfig = document.querySelector(`#prevConfig${set}`).checked;
let prevSupport = document.querySelector(`#prevSupport${set}`).checked;

// Set option values
options[`setName${set}`] = setName;
Expand All @@ -366,7 +366,7 @@ function exportOptions() {
options[`delaySecs${set}`] = delaySecs;
options[`prevOpts${set}`] = prevOpts;
options[`prevAddons${set}`] = prevAddons;
options[`prevConfig${set}`] = prevConfig;
options[`prevSupport${set}`] = prevSupport;
}

// General options
Expand Down Expand Up @@ -440,7 +440,7 @@ function importOptions() {
let delaySecs = options[`delaySecs${set}`];
let prevOpts = options[`prevOpts${set}`];
let prevAddons = options[`prevAddons${set}`];
let prevConfig = options[`prevConfig${set}`];
let prevSupport = options[`prevSupport${set}`];

// Set component values
if (setName != undefined) {
Expand Down Expand Up @@ -535,10 +535,10 @@ function importOptions() {
element.checked = isTrue(prevAddons);
}
}
if (prevConfig != undefined) {
let element = document.querySelector(`#prevConfig${set}`);
if (prevSupport != undefined) {
let element = document.querySelector(`#prevSupport${set}`);
if (!element.disabled) {
element.checked = isTrue(prevConfig);
element.checked = isTrue(prevSupport);
}
}
}
Expand Down Expand Up @@ -583,7 +583,7 @@ function disableSetOptions(set) {
"day0", "day1", "day2", "day3", "day4", "day5", "day6",
"blockURL", "defaultPage", "delayingPage", "blankPage", "homePage",
"activeBlock", "countFocus", "delayFirst", "delaySecs",
"prevOpts", "prevAddons", "prevConfig", "cancelLockdown"
"prevOpts", "prevAddons", "prevSupport", "cancelLockdown"
];
for (let item of items) {
let element = document.querySelector(`#${item}${set}`);
Expand Down

0 comments on commit b49b5ca

Please sign in to comment.