A common need for extensions is to have a single long-running script to manage some task or state. Background pages to the rescue.
Assume I have a simple requirement, I hope it will print current timestamp each 3 seconds in background.
Steps are as bellows:
1. Define background scripts in manifest.json
2. Create background.js
3. Reload extensions and open background page to test