'Browser extension popup kept loaded

I am looking to keep the browser extension pop-up loaded so that when you try to open it, the contents of it do not have to load every time.

I am currently specifying my pop-up through browser action in manifest.json like so:

"browser_action": {
        "default_icon": "icon128.png",
        "default_popup": "popup.html"
      }

I found this answer from 8 years ago Chrome Extension keep popup loaded, but the method it outlines, making the window 1 px high and expanding it back when pressed seems unideal. Is there a better built-in way to do so?

I am specifically trying to write an extension for firefox, and thus cannot use manifest v3 features as well, although I am not sure how much that matters.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source