Various guides and experiments

Disable F12 from opening the Developer Console in Chrome

F12 keyLinus Torvalds made a post on Google+ asking if there was a convenient way of disabling F12 from opening the developer console in Chrome (because apparently he’s “totally spastic and uncontrolled” when going for backspace ;)).

I, of course, had to oblige by creating a Chrome extension: Disable F12 on Chrome Web Store

It can access “your data on all websites” because it needs to inject a JavaScript that captures the F12 keypress and prevents the event from going any further. You can inspect the code in the extension yourself but if you can’t be bothered here it is:


	"name": "Disable F12",
	"version": "1.0",
	"description": "An extension to disable F12 opening the dev console.",
	"icons": { "128": "icon128.png" },
	"content_scripts": [
			"matches": ["*://*/*"],
			"js": ["disablef12.js"]


window.addEventListener("keydown", keyListener, false);

function keyListener(e) {
	if(e.keyCode == 123) {
		e.returnValue = false;

Posted in Chrome Extensions | 7 Comments

7 responses to “Disable F12 from opening the Developer Console in Chrome”

  1. Ian Kelling says:

    I installed your extension and F12 still opens the console every time. Any help you can offer? Chrome 18.0.1025.151 m.

  2. Ian Kelling says:

    Actually, I enabled the option to work in incognito mode and now it works fine.

  3. Ian Kelling says:

    Even though I was not in inconito mode.

  4. YOUNGSTER says:

    i have an easy idea.
    step1:- simply download & add firebug lite from chrome web store.

    step2:- by clicking on firebug lite, enable firebug.

    step3:- now press the button F12.

    now you see that chrome console has not opening but the firebug lite has open.

    to throw this problem.

    step4:- simply click again on firebug lite.

    now when you want firebug open. firebug is very trustable.

  5. Lectrik says:

    Worked perfectly, needed this for a kiosk wayfinder! BTW it won’t work until your restart Chrome if you were trying it immediately after installing the extension.
    Thank you!

  6. Rob says:

    I understand that this thread it old but I found the ext via search engine and installed it…..however.
    Not sure when this stopped working but I installed it recently and it’s useless, does not work at all!!!

  7. nemrod says:

    Hi Rob,
    Not sure what to tell you—it works just fine for me. Make sure you’re in a new tab created after enabling the extension when trying it, and IIRC it doesn’t work in chrome internal pages (i.e. chrome:// URLs). Might be it doesn’t work on some configuration of browser and operating system that I haven’t tested. Could be an isolated site as well, so check other sites to make sure.

Leave a Reply

Your email address will not be published. Required fields are marked *