diff --git a/scripts/background.js b/scripts/background.js index 05363d9..daed699 100644 --- a/scripts/background.js +++ b/scripts/background.js @@ -204,7 +204,7 @@ const updateState = (tabId, state) => { }; /** - * @description Listens to content messages + * @description Listens to messages */ chrome.runtime.onMessage.addListener((request, sender, responseCallback) => { @@ -252,3 +252,13 @@ chrome.runtime.onMessage.addListener((request, sender, responseCallback) => { return true; }); + +/** + * @description Listens to updates + */ + +chrome.runtime.onInstalled.addListener((reason) => { + if (reason === chrome.runtime.OnInstalledReason.UPDATE) { + chrome.storage.local.clear(); + } +});