When the user clicks on my addon's button in the browser toolbar, I want to display a drop-down menu with dynamic HTML content. The documentation suggests using a panel, but there is a problem. The content may change while the addon is running, and panels typically work with predefined HTML files.
Although panel
allows changing content through scripts provided by the contentScript
property, this method could result in the addon not being approved as stated in the documentation:
Warning: Unless your content script is extremely simple and consists only of a static string, don't use contentScript: if you do, you may have problems getting your add-on approved on AMO.
Instead, keep the script in a separate file and load it using contentScriptFile. This makes your code easier to maintain, secure, debug and review.
So, what alternatives are available for achieving this functionality?