Commit e6f311f7 authored by grtgarrett's avatar grtgarrett
Browse files

Messing with options

parent db92a46f
......@@ -58,7 +58,7 @@ const Setting = {
'STRIP_METADATA': 'stripMetadata',
'WHITELISTED_DOMAINS': 'whitelistedDomains',
'XHR_TEST_DOMAIN': 'xhrTestDomain',
'STATS_ENABLED': 'statsEnabled'
'STATS_ENABLED': false
};
const WebRequest = {
......
......@@ -31,6 +31,7 @@ main._initializeOptions = function () {
[Setting.BLOCK_MISSING]: false,
[Setting.DISABLE_PREFETCH]: true,
[Setting.STRIP_METADATA]: true,
[Setting.STATS_ENABLED] : false,
[Setting.WHITELISTED_DOMAINS]: {}
};
......
......@@ -33,7 +33,17 @@ stateManager.registerInjection = function (tabIdentifier, injection) {
registeredTab.injections[injectionIdentifier] = injection;
injectionCount = Object.keys(registeredTab.injections).length || 0;
stateManager.pastTenSites().then(function (value) {
console.log(Setting.STATS_ENABLED.valueOf());
if(Setting.STATS_ENABLED === false) {
console.log('woops');
}
if(stateManager.s) {
console.log('woo');
}
statistics.pastTenSites().then(function (value) {
console.log(value);
});
......
......@@ -63,6 +63,23 @@
</section>
<section class="option">
<div class="title-option">
<label class="label-checkbox">
<input class="input-checkbox" data-option="statsEnabled" type="checkbox">
<span>Enable Statistics</span>
</label>
</div>
<div class="description-option">Show usage statistics</div>
</section>
<section class="option">
<div class="title-option">
......
......@@ -46,6 +46,7 @@ options._renderOptionsPanel = function () {
elements.disablePrefetch.checked = options._optionValues.disablePrefetch;
elements.stripMetadata.checked = options._optionValues.stripMetadata;
elements.whitelistedDomains.value = domainWhitelist;
elements.statsEnabled.checked = options._optionValues.statsEnabled;
options._registerOptionChangedEventListeners(elements);
options._registerMiscellaneousEventListeners();
......@@ -82,6 +83,7 @@ options._registerOptionChangedEventListeners = function (elements) {
elements.showIconBadge.addEventListener('change', options._onOptionChanged);
elements.blockMissing.addEventListener('change', options._onOptionChanged);
elements.disablePrefetch.addEventListener('change', options._onOptionChanged);
elements.statsEnabled.addEventListener('change', options._onOptionChanged);
elements.stripMetadata.addEventListener('change', options._onOptionChanged);
elements.whitelistedDomains.addEventListener('keyup', options._onOptionChanged);
};
......
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