I'd like to enable the "Custom formatters" setting in my Electron app's dev tools as described here: https://github.com/MarshallOfSound/electron-devtools-installer/issues/36#issuecomment-285956783
Enabling the setting manually is possible, but I'd like to do it automatically when dev tools is opened so that other developers don't have to remember to do it themselves.
Is it possible to automatically enable this setting with dev tools commands, via the Electron Debugger
API?
I found that clicking the checkbox in dev tools goes through this code path in Chromium, but otherwise I wasn't able to figure out how I could do this programmatically using the debugger API.
I tried the following:
mainWindow.webContents.once("dom-ready", async () => {
const debug = mainWindow.webContents.debugger;
try {
debug.attach("1.1");
} catch (err) {
// debugger may already be attached
}
try {
await debug.sendCommand("Runtime.enable");
await debug.sendCommand("Runtime.setCustomObjectFormatterEnabled", { enabled: true });
} finally {
debug.detach();
}
});
But the setting doesn't appear to change.