Skip to content

Instantly share code, notes, and snippets.

@desprit
desprit / titleChanger.js
Created July 1, 2022 11:45
Never ever do this on your website
(function () {
var titleValue = document.title;
var hidden = "hidden";
function onchange() {
document.title = document.hidden ? "Pssst! We’re Still Here…" : titleValue;
}
if (hidden in document) {
document.addEventListener("visibilitychange", onchange, false);