When using pop-out windows, event and primitive prototypes will differ from the main window, causing instanceof checks to fail in rare cases. When checking for HTMLElement, MouseEvent, etc., it is always preferable to use the .instanceOf(T) variant, over the regular instanceof T.