OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Is there an event or way to know when a Chrome Extension has been toggled on or off in the Extensions page?

  • Thread starter Thread starter theMaxx
  • Start date Start date
T

theMaxx

Guest
I've got a Chrome Extension that has been working fine so far.
When the extension is installed or started up, it needs to load some settings.
So I have been using this in my background page:

Code:
chrome.runtime.onInstalled.addListener(loadSettings);
chrome.runtime.onStartup.addListener(loadSettings);

Basically it runs the loadSettings() function to intialize the extension.

I've just come across an unexpected situation and after doing some research I could not find an answer.
It seems that when the extension is toggled off, the background page's loaded settings and variables are unloaded.
How can you know if the extension has been toggled off and on in the Chrome Extensions page? (at chrome://extensions/)

<p>I've got a Chrome Extension that has been working fine so far.<br>
When the extension is installed or started up, it needs to load some settings.<br>
So I have been using this in my background page:</p>

<pre><code>chrome.runtime.onInstalled.addListener(loadSettings);
chrome.runtime.onStartup.addListener(loadSettings);
</code></pre>

<p>Basically it runs the loadSettings() function to intialize the extension.</p>

<p>I've just come across an unexpected situation and after doing some research I could not find an answer.<br>
It seems that when the extension is toggled off, the background page's loaded settings and variables are unloaded.<br>
How can you know if the extension has been toggled off and on in the Chrome Extensions page? (at chrome://extensions/)</p>
 
Top