Disabling inspect element, right click and F12 in google chrome - google-chrome

Is there a way to disable inspect element, right click and F12 in google chrome?

This is definitely not possible to do from a web page.
Even if you disable right click and disable the default behaviors for F12, Ctrl+Shift+I, and Ctrl+Shift+J, there is no way to stop a user from opening Dev Tools on a different page and navigating to your page with Dev Tools already open.
Also, you can access Dev Tools by going to Menu > Tools > Developer tools, which cannot be prevented by any website.

You can run chromium in a java environment. This I have seen, then its impossible to open developer tools, and settings etc are not accessable. But of course it would involve a lot more work and development time.

Related

Chrome Dev Tools Snippets - AUTOSAVE

Is it possible to enable autosave on snippets in chrome dev tools?
It is infuriating when i accidentaly close a tab that dev tools was attached to where i had my snippets open and when i open dev tools again i've lost alot of work!
Are there any flags i can set to enable autosave or somehow get it to save when i run the snippet?
Just to be clear i am talking about the snippets under Sources/Snippets.
I know i can "just" use the shortcut ctrl-s to save however that is simply not good enough, i would atleast expect a recovery like all modern editors deliver.
Incase this cannot be achieved please point me the in direction where i can submit a feature request to the Chrome Dev Team
Select Tools > Developer Tools. The Developer Tools window opens as a docked panel at the side or bottom of Google Chrome. Click the Network tab. Select Preserve log.
Also, go to Settings in devtools, which is a little screw on the top-right corner, find the Console section under Preferences, and click on Preserve log upon navigation.
This has worked for me.

Chrome OS Developer Tools Disabled

On my school chromebook developer tools just got disabled or something.
When i right click to inspect an element, the "inspect" button is grayed out and if i click the options button in the top right, go down to more tools the developer tools button is grayed out there too.
Does anyone have any idea what is happening and why it is happening?
(Developer mode is enabled on my chromebook)
On a Chromebook, Chrome Developer Tools is enabled/disabled through Chrome Policies, which is maintained by the Chrome Management Console as part of a Google Work account. In this case, the policy is DeveloperToolsDisabled.
In Windows, it is possible to enable/disable it in the registry, and there is possibly a Preferences file in OSX.
I'm afraid you would need to speak to your school's IT department about this, as they are the only ones with access to these policies.

Is there any way to keep Developer Tools open when debugging a Chrome Extension?

I'm trying to debug a Chrome Extension but every time I refresh it, the developer tools window that is associated with the extension closes. Does anyone know if there is a way to keep it open?
Here's what I'm doing: I click the extension button, which opens a popup window. I then right click it and click "Inspect". That opens the Developer Tools. Now if I click the extension button again to refresh it (when I update code), the Developer Tools closes. :(
There are two ways to accomplish this.
Click on the Dev Tools popup so the window is focused and then press F5. This will reload the popup and Dev Tools, and will not cause the Dev Tools window to close.
If that doesn't work for you, go to chrome-extension://extensionid/path/to/popup.html on a separate tab on Chrome. From there, you can inspect element, and refreshing the file will not cause Dev Tools to close.
Dev Tools are closing because hosted page is closing (the popup). The view and it's logic stops working if you close the popup so there's nothing to inspect.
If you'd like to debug background page it will not close with the popup since it is running in background. That's all you can do.

Chrome dev tools settings: where is the Experiments tab to Allow custom UI themes?

I am using chrome version 36+
according to this page, I should be able to allow custom themes using the following instructions:
Installation Instructions
Add this theme
Goto chrome://flags and Enable Developer Tools experiments.
Open developer tools settings, select Experiments tab, and check 'Allow custom UI themes'.
Reload devtools.
I do not see such a tab in the dev tools settings. I see only 'general', 'workspace', and 'shortcuts'
These are some simple steps to follow, hope it will be helpful.
Open a new chrome tab, type chrome://flags
Find, "Enable Developer Tools experiments." using ctrl/cmd+f or simply searching for it by scrolling down the page.
Click the "enable" link
Click on "Relaunch Now" at the bottom of the page.
After restarting Chrome, open DevTools, DevTools settings, and select the experiments tab.
Now select the experiment you want (e.g. "Allow custom UI themes").
You need to reload devtools after: Alt-R will reload devtools itself, or you can just close and reopen it.
To get to the Dev Tools Experiments area you have to click on the gear icon in the inspector.
If still not working you should go to:
chrome://extensions/
And click the 'Enable' checkbox for the DevTools extension you wish to enable.
Had the same issue,
I found I was going to browser settings which is NOT where you should be going to ,
You need to go to developer setting .
i.e right click>inspect element> dev tools
You need to restart the browser after changing the flag at chrome://flags
I found it. There is a checkbox under experiments tab:
Allow custom UI themes
Restart chrome just not means to close the chrome and then open it. you should click the 'Relaunch Now' button of the flags tab. and then it's work for me.
loislo's answer is absolutely right (You need to restart the browser after changing the flag at chrome://flags). But notice that your chrome can work in the background. Go to the tray, look for the chrome icon and exit.
Navigate to chrome://flags/
Find and enable Developer Tools experiments Mac, Windows, Linux, Chrome OS
Relaunch Chrome, open develop tool, setting, you will see experiments tab.
My Chrome version: Version 61.0.3163.100
2022 update: There doesn't seem to be any option in chrome://flags but there is an option:
devtools > settings > experiments > Allow extensions to load custom stylesheets

How do you inspect the web inspector in Chrome?

According to Google this can be accomplished by visiting "chrome-devtools://devtools/devtools.html" in Chrome but now visiting that page in the stable version of Chrome (or Canary), just shows a 99% stripped version of the inspector.
To reiterate my "title" this is in reference to "inspecting" the inspector. Not just inspecting a normal webpage.
And while I don't think it's necessary to know to resolve the issue, I"m inspecting the inspector so I can style it as discussed by Paul Irish and here: https://darcyclarke.me/articles/development/skin-your-chrome-inspector/
Follow these easy steps!
Press Command+Option+i (Ctrl+Shift+i on Windows) to open DevTools.
Make sure that the developer tools are undocked into a new window. You may have to undock from the menu:
Press Command+Option+i again on this new window.
That will open the DevTools on the DevTools.
You can redock the page's DevTools if you want.
If it's not already, select Elements — it's the first icon at the top of the inspector.
A little beyond the scope of your question, but still valid in understanding why you're experiencing your problem can be found by understanding how Chrome Developer Tools: Remote Debugging works.
Open chrome://inspect
Open the inspector on that page (cmd + alt + i)
Scroll to the bottom of the page, under the Other section click the inspect link
The URL in the Other section should look something like this:
chrome-devtools://devtools/devtools.html?docked=true&dockSide=bottom&toolbarColor=rgba(230,230,230,1…
EDIT: they've fancied up the chrome:inspect page so you have to click the Other header on the left to get this to work now.
I just got this to work. The key is that you have to start up chrome in 'Remote Debugging' mode.
on OSX, open an terminal window and execute the following:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --remote-debugging-port=9222
On windows, Its
chrome.exe --remote-debugging-port=9222
(better windows instructions can be found here: https://developers.google.com/chrome-developer-tools/docs/remote-debugging#remote)
This will start up an instance of chrome, that will send debugging messages to a local webserver on port 9222.
If you access that web service, it will give you the ability to use the inspector to inspect any chrome window that is running. Since we want to inspect the inspector, we need to start an inspector window first (As above Use the shortcut keys; for Mac it's Command+option+i.)
Now, go ahead and navigate to
http://localhost:9222
It will present you with a list of windows to display in the debugger. Select the window that starts with "Developer Tools" and you'll be able to inspect the css for the inspector.
Its hard to see in the image below, but on the left I have my chrome window pointing at the remote debugger, highlighting one of the toolbar labels. On the right you see it lit up with the tooltip just as if we were debugging a web page.
A few weeks ago somebody pointed this out in stackoverflow's "javscript" chatroom. First, and very importantly, make sure the inspector is undocked from your browser window. Then it's just a matter of opening a inspector window and then inspecting that window. In windows it's CtrlShiftI (Edit: I said, CtrlShiftI but that brings up the console inspecting the console... you should be able to navigate back and forth.) for the keyboard shortcut. (Other keyboard combos for other options and OSes here and here.) Just do that twice and you're good.
Edit: ok, you're probably confused as to undock the window. This is what you'd click if it's docked..
Edit II: I'm not quite sure why you can't inspect. JDavis's answer is consistent with the Google Docs for Apple computers. If you're using Linux it appears to be the same as Windows. You supposed to hit the inspector key combination while the focus is over the inspector window.