Disable browser keyboard shortcuts with Javascript

A script to disable browser keyboard shortcuts.

Demo

Try some keyboard shortcut(s). The key [F11] is enabled, all others are disabled.

Description

This script disables keyboard shortcuts in any javascript enabled browser.

The block list is according to the official browser keyboard shortcuts for the Chromium browser, and should block all Chromium browser keyboard shortcuts.

While other browsers may have a few different shortcuts, most browsers share some common shortcuts. The script may easily be extended to target any other browser

Usage

Use this file with a "script" tag in the page template "<head>" section:

<script type="text/javascript" src="path/to/disable_keys.js"></script>

That's all.

Source code

Click "download" link below and the code will be visible

Download

disable_keys.js (3.8kB) (right-click the link, and choose "Save link/target as...")

Version and License

Version

Current version: 1

License

What? Free!