Trigger browser.browserAction.openPopup() without user action

Hello,

quick question about the documentation of browser.browserAction.openPopup()

It clearly states that openPopup() can only be called within a handler for a user action.

My addon periodically checks the status of a localhost service, and should ideally open the popup automatically.
Is there any workaround to achive this?

Thank you in advance!
Elias

I’m pretty sure you cannot open the popup from a random non-user UI event. Even the function browser.browserAction.openPopup is Firefox-only and won’t work with other browsers.

What you can do is change the browserAction icon so the user can notice it and opens the popup to see what’s going on, send a notification through browser.notifications, open a new window with the message (probably the closest to what you were trying to achieve with browser.browserAction.openPopup), …

Thank you for your ideas.
Opening the message in a new tab/windows should definitely work.

I’ll also try if browser.browserAction.openPopup can be triggered by a notification button.