🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Chat -- Confirm on leave

Started by
0 comments, last by fastcall22 8 years, 9 months ago
writ teh code:

window.addEventListener('beforeunload',function (e){
    return ((e||window.event).returnValue) = 'You are about to leave the chat.';
});
on the teh chat.


'cause i'm tired of accidentally navigating away from the chat when i fat finger the keyboard.
Advertisement
Beep boop. I've made a greasemonkey script in the meantime.


// ==UserScript==
// @name        Confirm Navigation on gdnet Chat
// @namespace   fastcall22.com
// @include     http://www.gamedev.net/chat/*
// @version     1.0
// @grant       none
// ==/UserScript==

(function(){
	window.addEventListener('beforeunload',function (e){
		return ((e||window.event).returnValue) = 'You are about to leave the chat.'
	})
})();
It's surprising how often you can accidentally leave the page from just the keyboard... alt+home, alt+backspace, backspace, ...

This topic is closed to new replies.

Advertisement