How can change heartbeat hasFocus option to false

After I check heartbeat.js file I found that by default WordPress set heartbeat hasFocuse option to true, I want to change this option to false what can I do?

What am I trying to achieve?

I have a live notification and messages system working depending on heartbeat.js the problem that if I switch from my site tab to any another tab the heartbeat stop working so I don’t receive the messages and notification until I switch to my site again.

Also if the mouse doesn’t move and not using the keyboard on my site the heartbeat stopped working.

I want to make something like Facebook to receive the notifications also if I switch from facebook tab.

0

Leave a Comment