StopTabAlerts - a bookmarklet to replace dynamic blinking alerts in tab with custom text

There is a question on the SuperUser StackExchange forum where a person annoyed with the Gmail Chat notifications in the browser tab wants to hide the blinking messages. If  Doe sends you a chat response, you would see the message "Doe says…" in the browser tab's title alternating with the text showing the count of unread email in your Inbox.

Such blinking messages are shown using a timer written in JavaScript which make use of the setInterval method. My solution to the above scenario was to mask that timer with a timer of my own that sets a fixed text message (I used the text "Advanced Rocket Engineering" so that anyone snooping on your computer may be impressed with your deep interest in science). Now how do you activate the timer? I'm fond of bookmarklets, so I thought a bookmarklet could do the job of overriding the blinking messages with custom text with just a click while you're on the Gmail tab.

The actual bookmarklet cannot be placed directly in the answer on the Super User forum so to make it easy to drag and drop the bookmarklet to the Bookmarks Bar (in Chrome or Bookmarks Toolbar in Firefox or the equivalent in any other browser) I have the ready-to-use bookmarklet here - StopTabAlerts

javascript:setInterval(function(){
document.title='Advanced Rocket Engineering'
},200);

Is this an efficient solution? I don't know. I did some basic testing in Chrome and it worked. If the code can be improved, please let me know.

The bookmarklet can be adapted for other scenarios where you want to get rid of blinking alerts in the browser tab.

Comments

Popular posts from this blog

Maven Crash Course - Learn Power Query, Power Pivot & DAX in 15 Minutes

"Data Prep & Exploratory Data Analysis" course by Maven Analytics

Oracle Cloud Infrastructure 2024 Generative AI Professional Course & Certification Exam (1Z0-1127-24)