Initialization of extension settings

222 views
Skip to first unread message

Costas Athan

unread,
Feb 18, 2022, 4:41:42 AM2/18/22
to Chromium Extensions
I'm reading this solution for initializing user options in Chrome extensions on Stackoverflow: https://stackoverflow.com/questions/23638777/provide-initial-settings-for-chrome-extension/23638867#23638867
chrome.storage.local.get({option: "default"}, function(data){
  chrome.storage.local.set(data, /*...*/);
});

My question is when does the set function execute?

My intention is to set the initial values of the settings' variables during the onInstalled event, but avoid resetting them during a browser version update.

Costas Athan

unread,
Feb 18, 2022, 9:57:14 AM2/18/22
to Chromium Extensions, Costas Athan
I wrote "avoid resetting the options during a browser version update". I should also add and during a version update of the extension itself.
Reply all
Reply to author
Forward
0 new messages