The other related question only states how to switch on/off JavaScript via the GUI Chrome provides. However, I want to toggle JavaScript programmatically from chrome console OR with a single key stroke (Such as tapping F12).
The reason I want this ability is because I am working on a web application which has a dropdown menu that I want to modify; I am not sure where in the codebase this dropdown menu is so I would like to pause execution and inspect it. Whenever I click on any of my developer tool options though to pause execution, it closes the dropdown menu.
A potential solution would be to simply put a debugger in the code where the dropdown menu is, but this is a chicken-and-egg problem because the whole point of pausing execution is to locate where in the codebase this drop down menu is.