Verified Commit 9508a3a3 authored by Thomas Rientjes's avatar Thomas Rientjes
Browse files

Enable users to manually enforce staging

parent d74879f3
...@@ -53,6 +53,7 @@ const Setting = { ...@@ -53,6 +53,7 @@ const Setting = {
'AMOUNT_INJECTED': 'amountInjected', 'AMOUNT_INJECTED': 'amountInjected',
'BLOCK_MISSING': 'blockMissing', 'BLOCK_MISSING': 'blockMissing',
'DISABLE_PREFETCH': 'disablePrefetch', 'DISABLE_PREFETCH': 'disablePrefetch',
'ENFORCE_STAGING': 'enforceStaging',
'SHOW_ICON_BADGE': 'showIconBadge', 'SHOW_ICON_BADGE': 'showIconBadge',
'SHOW_RELEASE_NOTES': 'showReleaseNotes', 'SHOW_RELEASE_NOTES': 'showReleaseNotes',
'STRIP_METADATA': 'stripMetadata', 'STRIP_METADATA': 'stripMetadata',
......
...@@ -30,6 +30,7 @@ main._initializeOptions = function () { ...@@ -30,6 +30,7 @@ main._initializeOptions = function () {
[Setting.SHOW_ICON_BADGE]: true, [Setting.SHOW_ICON_BADGE]: true,
[Setting.BLOCK_MISSING]: false, [Setting.BLOCK_MISSING]: false,
[Setting.DISABLE_PREFETCH]: true, [Setting.DISABLE_PREFETCH]: true,
[Setting.ENFORCE_STAGING]: false,
[Setting.STRIP_METADATA]: true, [Setting.STRIP_METADATA]: true,
[Setting.WHITELISTED_DOMAINS]: {} [Setting.WHITELISTED_DOMAINS]: {}
}; };
...@@ -37,7 +38,13 @@ main._initializeOptions = function () { ...@@ -37,7 +38,13 @@ main._initializeOptions = function () {
chrome.storage.local.get(optionDefaults, function (options) { chrome.storage.local.get(optionDefaults, function (options) {
if (options === null) { if (options === null) {
options = optionDefaults; options = optionDefaults; // Restore option defaults.
}
if (options.enforceStaging === true) {
// Improve coverage at the cost of website stability.
stateManager.setExtensionEnvironment('staging');
} }
if (options.disablePrefetch !== false) { if (options.disablePrefetch !== false) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment