[SOLVED] If app is focused?

While this might be very easy to code,I was wondering if there’s anything built-in like if (this.app.isFocused) ?

Working with app and overlaying html/css ui

I’m not sure what you mean by “app having focus”, maybe this:

setInterval(() => {
  const ret = document.hasFocus();
  console.log("hasFocus", ret);
}, 1000);

?

There is also the newer page visibility API: Page Visibility API - Web APIs | MDN

1 Like

Thank you guys