How to check if DevTools in browser (Firefox, Chrome) is opened?

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Haswell
Posts: 90
Joined: 21 Feb 2016, 17:11

How to check if DevTools in browser (Firefox, Chrome) is opened?

09 Mar 2022, 07:47

Is there any way to check whether DevTools (Ctrl + Shift + I) in Firefox/Chrome is opened now? (except unreliable and heavy ImageSearch)
I want to build my own logic based on that fact for my hotkeys (if DevTools is opened - use default behaviour for F2 and Escape, otherwise - use my code).
Focusing our efforts on non-productive and non-creative endeavours wastes lives as surely as war.
Jacque Fresco / The best that money can't buy
Hardcoder
Posts: 278
Joined: 19 Feb 2022, 13:13
Location: Germany

Re: How to check if DevTools in browser (Firefox, Chrome) is opened?

09 Mar 2022, 08:17

Just wait for the Window, if you just want to know if it exists, no matter if its active, use WinExist and WinWait instead.

Code: Select all

Loop
{
	If ( not WinActive("Developer Tools AHK_exe vivaldi.exe") )
		WinWaitActive, Developer Tools AHK_exe vivaldi.exe
	
	MsgBox, Developer Tools are active
	
	WinWaitClose, Developer Tools AHK_exe vivaldi.exe
}
Haswell
Posts: 90
Joined: 21 Feb 2016, 17:11

Re: How to check if DevTools in browser (Firefox, Chrome) is opened?

09 Mar 2022, 08:46

Thanks for your idea to open DevTools in a new window.
And is there any way to do when DevTools is a part of a main browser's window?
Focusing our efforts on non-productive and non-creative endeavours wastes lives as surely as war.
Jacque Fresco / The best that money can't buy
malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: How to check if DevTools in browser (Firefox, Chrome) is opened?

09 Mar 2022, 08:53

I would write js extension, that detects devtools, comparing window.outerWidth with window.innerWidth and window.outerHeight with window.innerHeight and create ahk communication with native messaging.
Hardcoder
Posts: 278
Joined: 19 Feb 2022, 13:13
Location: Germany

Re: How to check if DevTools in browser (Firefox, Chrome) is opened?

09 Mar 2022, 08:57

I totally forgot, you can have them docked :think:
Sorry, I don't see any difference in the window or process, when they are open.
Some other users here have more experience with chrome specifics, maybe they can help you :/

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], peter_ahk and 117 guests