At I just did a few tests, and it looks the whole routine - `querySelectorAll('menupopup, panel')` plus `for p in popups` takes on average .5 to 1 millisecond on my pretty descent machine. In some cases it raises to 7-8 milliseconds - when there is lot going on the page. I use `utils.timeIt` function for timing the execution repeating the routine 100 times. So it looks like it can be an issue. I still suggest to use events for capturing the popup open/closed flag, and then double check in case it's set using your method