my chrome extension popup opens after a few seconds, it's slow compared to other extensions

前提是你 提交于 2019-11-30 18:22:06

What worked for was to add an empty background page. This is not explained in the Google Documentation (or at least I did not find it), so it was more of a fluke, but seems to work.

The idea is that the plugin is loaded once when you come to the page (so before you even click), as opposed to being reloaded over and over again on each click.

In the manifest add something like:

{
  //...
  "background": {
    "page": "bg.html"
  }
  //...
}

And the bg.html can just be an empty HTML file:

<html>

</html>

Again - never found an explicit link or resource explaining why this should be done like this, and I am not sure it is the best practice, but it did work for me.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!