Adds useful debug features to your Electron app
86
Build a utility for Electron applications that enables developers to programmatically activate element inspection mode in their app windows.
Create a function that activates element inspection mode in an Electron BrowserWindow. When activated, the element inspector should allow developers to visually select and inspect DOM elements, similar to the "Inspect Element" feature in web browsers.
Study the electron-debug package to understand how it implements element inspection functionality. Your implementation should handle both scenarios: when developer tools are already open and when they need to be opened first.
The tool must provide a way to activate the element inspector for a given browser window. When activated:
@generates
/**
* Activates the element inspector on the given BrowserWindow.
* Opens DevTools if not already open, then enters inspect element mode.
*
* @param {BrowserWindow} window - The Electron BrowserWindow to activate inspector on
*/
function activateInspector(window) {
// IMPLEMENTATION HERE
}
module.exports = { activateInspector };Provides debugging utilities for Electron applications. Study how it implements element inspection to understand the best approach.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-electron-debugdocs
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10