BackspaceMeansBackspace

A sensible extension for Google Chrome.


So there I am, happily typing away at one of those uber-important emails in my webmail ..
You know, the kind that if it doesn't get sent on time, people will be insulted, treaties will be rescinded and nuclear war might ensue.
And the scene goes a little something like this:
*type type type* *Backspace* *Backspace*
*type type type*
*type type ..* "Oh, darn" *Backspace*
*SKADOOSH*

Google Chrome must be confused. It thought BACKSPACE meant go BACK to the previous web page.
Crap.
Forward, please. I had nearly an hour of thoughts layed out there.
"No problem, my good man. I'll just need to resubmit that form."
(ie, your entire email is lost to the ether, never to be found again)
!! ... !

Enter the BackspaceMeansBackspace extension.
Install this extension to turn that annoying behaviour THE HECK OFF.
(ie, Backspace means Backspace means Backspace. And never means BACK button. Yeesh)

Download it here. (Latest version is 1.2, released 18 October 2009)

Note that a development release of Google Chrome is required to use Extensions.

More information from Google here.


For anyone who's interested, here's the code with comments:
// BackspaceMeansBackspace.js

// Add the capturing event listener to the global object
window.addEventListener ('keydown', function (e) {
	// If the key pressed was a backspace key, handle it specially
	if (e.keyIdentifier == 'U+0008' || e.keyIdentifier == 'Backspace')
	{
		// If the target of the backspace was the body element, handle it specially
		if (e.target == document.body)
		{
			// Prevent the default Backspace action from happening
			e.preventDefault ();
		}
	}
}, true);