Skip to content

Commit

Permalink
feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
ebidel committed Feb 3, 2017
1 parent 5a26e66 commit 248f9b9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions lighthouse-extension/app/src/lighthouse-background.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const STORAGE_KEY = 'lighthouse_audits';
const SETTINGS_KEY = 'lighthouse_settings';

let installedExtensions = [];
let DISABLE_EXTENSIONS_DURING_RUN = false;
let disableExtensionsDuringRun = false;
let lighthouseIsRunning = false;
let latestStatusLog = [];

Expand All @@ -43,7 +43,7 @@ const _flatten = arr => [].concat(...arr);
* @param {!Promise}
*/
function enableOtherChromeExtensions(enable) {
if (!DISABLE_EXTENSIONS_DURING_RUN) {
if (!disableExtensionsDuringRun) {
return Promise.resolve();
}

Expand Down Expand Up @@ -259,7 +259,6 @@ window.getDefaultAggregations = function() {
* Save currently selected set of aggregation categories to local storage.
* @param {!{selectedAggregations: Array<{name: string, audits: !Array<string>}>,
* disableExtensions: boolean}} settings
* @param {!boolean} disableExtensions True if extensions should be disabled for the run.
*/
window.saveSettings = function(settings) {
const storage = {
Expand All @@ -273,8 +272,8 @@ window.saveSettings = function(settings) {
});

// Stash disable extensionS setting.
DISABLE_EXTENSIONS_DURING_RUN = settings.disableExtensions;
storage[SETTINGS_KEY].disableExtensions = DISABLE_EXTENSIONS_DURING_RUN;
disableExtensionsDuringRun = settings.disableExtensions;
storage[SETTINGS_KEY].disableExtensions = disableExtensionsDuringRun;

// Save object to chrome local storage.
chrome.storage.local.set(storage);
Expand All @@ -300,7 +299,7 @@ window.loadSettings = function() {
const savedAggregations = Object.assign(defaultAggregations, result[STORAGE_KEY]);

const defaultSettings = {
disableExtensions: DISABLE_EXTENSIONS_DURING_RUN
disableExtensions: disableExtensionsDuringRun
};
const savedSettings = Object.assign(defaultSettings, result[SETTINGS_KEY]);

Expand Down
2 changes: 1 addition & 1 deletion lighthouse-extension/app/src/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ function initPopup() {

const okButton = document.getElementById('ok');
okButton.addEventListener('click', () => {
// Save selected aggregation categories on options page close.
// Save settings when options page is closed.
const selectedAggregations = Array.from(optionsEl.querySelectorAll(':checked'))
.map(input => input.value);
const disableExtensions = document.querySelector('.setting-disable-extensions').checked;
Expand Down

0 comments on commit 248f9b9

Please sign in to comment.