Question

A browserAction in my Chrome extension takes about 250ms to display its popup, popup.html. However, when popup.html is already open in a tab in the browser, then the browserAction popup displays almost instantly.

manifest.json:

{
  "manifest_version": 2,
  "version": "1.0.0",
  "name": "MyExtension",

  "browser_action": {
    "default_icon": "icon-38x38.png",
    "default_popup": "popup.html"
  }
}

popup.html:

<!doctype html>
<html>
 <body>
  <div>hello<div>
 </body>
</html>

Chrome DevTools shows the tab fully loaded in 2ms.

How do I make it fast? Can I keep popup.html always loaded in the background?

Était-ce utile?

La solution

Modify manifest.json to include

"background": {
    "page": "popup.html"
},
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top