Reputation: 4361
In a Safari extension, is there a way to trigger some code when a popover is hidden?
There is the popover
event when the popover is first shown, but I haven't found the opposite, when the popover is hidden.
I use <progress>
elements in the popover, and they seem to be very CPU hungry, so I would like to disable them when the popover is not shown.
Upvotes: 0
Views: 381
Reputation: 2829
From within the popover,
window.onblur = function (e) {
// do something
};
should do the trick.
Upvotes: 2