Skip to content

Commit

Permalink
set document hidden log
Browse files Browse the repository at this point in the history
  • Loading branch information
olivaresf committed Jul 11, 2023
1 parent 3d70af4 commit e889320
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Source/WebView/turbo.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,10 @@
postMessageAfterNextRepaint(name, data) {
// Post immediately if document is hidden or message may be queued by call to rAF
if (document.hidden) {
console.log("🔒 Document is hidden")
this.postMessage(name, data);
} else {
console.log("🔒 Document is not hidden")
var postMessage = this.postMessage.bind(this, name, data)
requestAnimationFrame(() => {
requestAnimationFrame(postMessage)
Expand Down

0 comments on commit e889320

Please sign in to comment.