Bug 1626741 Comment 12 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Off-hand, I think one could add a closeAllPopups() method to nsIAppWindow, in the implementation just
```
  if (nsXULPopupManager* pm = nsXULPopupManager::GetInstance()) {
    pm->Rollup({});
  }
```
appWindow is reachable through `window.docShell.treeOwner.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIAppWindow)`

I don't know if this is the right approach, but it may be worth trying.
Off-hand, I think one could add a rollupAllPopups() method to nsIAppWindow, in the implementation just
```
  if (nsXULPopupManager* pm = nsXULPopupManager::GetInstance()) {
    pm->Rollup({});
  }
```
appWindow is reachable through `window.docShell.treeOwner.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIAppWindow)`

I don't know if this is the right approach, but it may be worth trying.
Off-hand, I think one could add a rollupAllPopups() method to nsIAppWindow, in the implementation just
```
  if (nsXULPopupManager* pm = nsXULPopupManager::GetInstance()) {
    pm->Rollup({});
  }
```
appWindow is reachable through `window.docShell.treeOwner.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIAppWindow)`

I don't know if this is the right approach, but it may be worth trying (I'll try it locally).

Back to Bug 1626741 Comment 12