Skip to content

Fixes #36#37

Open
seedofjoy wants to merge 1 commit intovitvad:masterfrom
seedofjoy:patch-1
Open

Fixes #36#37
seedofjoy wants to merge 1 commit intovitvad:masterfrom
seedofjoy:patch-1

Conversation

@seedofjoy
Copy link

Fix resetting settings to default when you upgrade your browser.

Fix resetting settings to default when you upgrade your browser.
@jdart
Copy link

jdart commented Aug 17, 2016

Those defaults might be set for a reason, maybe something like the below would be safer. This is completely untested!

chrome.storage.local.get('active', function(value) {
  if (!chrome.runtime.lastError) // storage already set
    return;
  chrome.storage.local.set({
    active: false,
    urls: ["<all_urls>"],
    exposedHeaders: ''
  });
});

@jdart
Copy link

jdart commented Aug 17, 2016

@vitvad How does my above comment look to you?

@jdart
Copy link

jdart commented Aug 17, 2016

resolves #36

@seedofjoy
Copy link
Author

@jdart my code doesn't broke anything because of this:
chrome.storage.local.get({'active': false, 'urls': ["<all_urls>"], 'exposedHeaders': ''}, function(result) { - this is single place where settings are used (with default settings)

@jdart
Copy link

jdart commented Aug 17, 2016

Oh cool, well, I'd love to see this merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments