I am sending to the keybindings function an iframe body reference and the events are not fired.
I found out this is because of this check if (!(event instanceof KeyboardEvent)) { return }.
From what I read on MDN, instanceof doesn't work as expected when used between different contexts, such as different frames, because they have different execution environments so even the KeyboardEvent type is considered different.
I am sending to the keybindings function an iframe body reference and the events are not fired.
I found out this is because of this check
if (!(event instanceof KeyboardEvent)) { return }.From what I read on MDN, instanceof doesn't work as expected when used between different contexts, such as different frames, because they have different execution environments so even the KeyboardEvent type is considered different.