mozilla-extensions/firefox-voice

Create function to open popup but not listen

ianb opened this issue · 0 comments

ianb commented

Right now openPopup() opens the popup and triggers the normal flow. But sometimes we want to do something more specific, like show a timer or a reminder. Typically the pattern is: (a) try to send a message in case the popup is already open, (b) if that fails, then open the popup, (c) try to send a message to the popup again

So there could be a function like openPopupWithMessage({...}) that would go through this. It could also open popup.html?nolisten which could stop the popup from initiating the standard listening. In that case the popup could send a message like "popupReady" which tells the function that it can send its message.