webview devtools

This commit is contained in:
Evan Simkowitz 2024-09-09 15:41:26 -07:00
parent dc16d9be3d
commit 65a10ffb36
No known key found for this signature in database

View file

@ -324,6 +324,23 @@ export class WebViewModel implements ViewModel {
}
return false;
}
getSettingsMenuItems() {
return [
{
label: this.webviewRef.current?.isDevToolsOpened() ? "Close DevTools" : "Open DevTools",
click: async () => {
if (this.webviewRef.current) {
if (this.webviewRef.current.isDevToolsOpened()) {
this.webviewRef.current.closeDevTools();
} else {
this.webviewRef.current.openDevTools();
}
}
},
},
];
}
}
function makeWebViewModel(blockId: string, nodeModel: NodeModel): WebViewModel {