How to monitor the entry and departure of the page

want to know how the effect in the picture is realized

description: when you open this page, title is changed to "you found it" and reverts to the real title after a few seconds. Modify title, again when you leave this page. What method is used to monitor page switching
page address

Apr.25,2021

determine whether the browser has gained or lost focus, and then dynamically modify title

window.onfocus = function () {
  document.title = "';
};
window.onblur = function () {
  document.title = "';
};

// 
function browser_status(action) {
    // 
    let hidden, state, visibilityChange,status
    if (typeof document.hidden !== "undefined") {
        hidden = "hidden"
        visibilityChange = "visibilitychange"
        state = "visibilityState"
    } else if (typeof document.mozHidden !== "undefined") {
        hidden = "mozHidden"
        visibilityChange = "mozvisibilitychange"
        state = "mozVisibilityState"
    } else if (typeof document.msHidden !== "undefined") {
        hidden = "msHidden"
        visibilityChange = "msvisibilitychange"
        state = "msVisibilityState"
    } else if (typeof document.webkitHidden !== "undefined") {
        hidden = "webkitHidden"
        visibilityChange = "webkitvisibilitychange"
        state = "webkitVisibilityState"
    }

    // title
    document.addEventListener(visibilityChange, function() {
        status = document[state]
        if (document[state] == 'hidden') {
            document.title = "'
        } else {
            document.title = "'
        }
    }, false)
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e43397-26f55.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e43397-26f55.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?