Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Extension Persistent

I am trying to learn about chrome extension development.

There I saw something like this manifest.json

 "background" : {
      "scripts": ["Scripts/event.js"],
      "persistent": false
    }, 

Here, i am unable to understand what does "persistent": false means, According to my very vague understanding, I think it deals wether the background page should run in background at all times or not.

So If persistent is true, It will run even when we are working on tabs? and if it is false, it will stop it won't stop the moment we leave the browser?


1 Answers

From the documentation:

The only occasion to keep a background script persistently active is if the extension uses chrome.webRequest API to block or modify network requests. The webRequest API is incompatible with non-persistent background pages.

https://developer.chrome.com/docs/extensions/mv2/background_pages/

like image 87
maddy Avatar answered Sep 07 '25 19:09

maddy