Why does my Chrome Extension reload when I refresh the page? - google-chrome-extension

I am developing a Chrome extension with Parcel and when I refresh any page, my Chrome extension's icon will do the reloading animation (it disappears and quickly animated in from the right). This is a problem because it seems to be resetting my background script which contains some variables that need to persist. I'm not sure where to look because there aren't any errors logged.

Related

Chrome extension getUserMedia not working in background.js

I am making a chrome extension that will allow recording screen but I want to do this in background script without even opening options page. How can I achieve this in chrome extension. I can see other extensions like loom are able to do so
I tried injecting script in tab but as soon as tab closes screen sharing disappears. I also tried to use getUserMedia or desktopapture in background.js but It didnot work

Is there a way to access chrome extension background pages on Cypress?

I'm interested in seeing the network tab in an extension's background page while running tests using Cypress.
When I go to chrome://extensions and click background page within the Cypress browser nothing pops up. I've also tried navigating directly to chrome-extension://(extension-id)/_generated_background_page.html but this stops the extension from working entirely.

How can I remain on same page window on Chrome browser extension when it closes?

I'm developing a Chrome browser extension that that has different menu links that go to different pages in the extension. I noticed each time the extension closes I have to navigate back to the last page I was on in the extension.
Is there a way to keep the last page I'm on current even if the extension window closes?

Reload chrome extension after taking user input from options page

I am trying to make a simple chrome extension, which shows some options on right click. There is an options page where the user can enter his preferences(what options to show on right click and what not to). When the user's preferences are saved, they are not reflected in the behavior of the extension until it is reloaded or chrome is restarted. How can I avoid this? I want the changes to come into effect immediately.
You can reload your extension by reloading the background page:
chrome.extension.getBackgroundPage().window.location.reload()

How do I load my extension on chrome startup?

I have developed a google chrome extension and I have a badge on the icon that displays a number.
When I start the browser the badge is not displayed. So I think I have to load the extension when chrome browser was started.
Is that possible?
Code in a background page is executed when a new browser window is created.

Resources