[v3] Add EnableDevTools option

This commit is contained in:
Lea Anthony
2023-06-20 08:49:25 +10:00
parent ab38b20444
commit 3355d5f0af
11 changed files with 38 additions and 34 deletions
+23 -22
View File
@@ -167,36 +167,37 @@ An 'X' indicates that the option is not supported by the platform.
| Feature | Windows | Linux | Mac | Notes |
|---------------------------------|---------|-------|-----|--------------------------------------------|
| Name | Y | | | |
| Title | Y | | | |
| Width | Y | | | |
| Height | Y | | | |
| AlwaysOnTop | Y | | | |
| URL | Y | | | |
| DisableResize | Y | | | |
| Frameless | Y | | | |
| MinWidth | Y | | | |
| MinHeight | Y | | | |
| MaxWidth | Y | | | |
| MaxHeight | Y | | | |
| StartState | Y | | | |
| Mac | - | - | | |
| BackgroundType | | | | Acrylic seems to work but the others don't |
| BackgroundColour | Y | | | |
| BackgroundType | | | | Acrylic seems to work but the others don't |
| CSS | Y | | | |
| DevToolsEnabled | Y | | Y | |
| DisableResize | Y | | | |
| EnableDragAndDrop | | | | |
| EnableFraudulentWebsiteWarnings | | | | |
| Focused | Y | | | |
| Frameless | Y | | | |
| FullscreenButtonEnabled | Y | | | |
| Height | Y | | | |
| Hidden | Y | | | |
| HTML | Y | | | |
| JS | Y | | | |
| CSS | Y | | | |
| Mac | - | - | | |
| MaxHeight | Y | | | |
| MaxWidth | Y | | | |
| MinHeight | Y | | | |
| MinWidth | Y | | | |
| Name | Y | | | |
| OpenInspectorOnStartup | | | | |
| StartState | Y | | | |
| Title | Y | | | |
| URL | Y | | | |
| Width | Y | | | |
| Windows | Y | - | - | |
| X | Y | | | |
| Y | Y | | | |
| FullscreenButtonEnabled | Y | | | |
| Hidden | Y | | | |
| EnableFraudulentWebsiteWarnings | | | | |
| Zoom | | | | |
| ZoomControlEnabled | | | | |
| OpenInspectorOnStartup | | | | |
| EnableDragAndDrop | | | | |
| Windows | Y | - | - | |
| Focused | Y | | | |
### Log
+1 -1
View File
@@ -3,7 +3,7 @@ import {newRuntimeCaller} from "./runtime";
let call = newRuntimeCaller("contextmenu");
function openContextMenu(id, x, y, data) {
return call("OpenContextMenu", {id, x, y, data});
void call("OpenContextMenu", {id, x, y, data});
}
export function enableContextMenus(enabled) {
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -46,6 +46,9 @@ type WebviewWindowOptions struct {
// ShouldClose is called when the window is about to close.
// Return true to allow the window to close, or false to prevent it from closing.
ShouldClose func(window *WebviewWindow) bool
// If true, the window's devtools will be available (default true in builds without the `production` build tag)
DevToolsEnabled bool
}
var WebviewWindowDefaults = &WebviewWindowOptions{
+1 -1
View File
@@ -973,7 +973,7 @@ func (w *macosWebviewWindow) run() {
w.setMaxSize(w.parent.options.MaxWidth, w.parent.options.MaxHeight)
}
//w.setZoom(w.parent.options.Zoom)
if isDebugMode() {
if isDebugMode() || w.parent.options.DevToolsEnabled {
w.enableDevTools()
}
w.setBackgroundColour(w.parent.options.BackgroundColour)
+1 -1
View File
@@ -1176,7 +1176,7 @@ func (w *windowsWebviewWindow) setupChromium() {
if err != nil {
globalApplication.fatal(err.Error())
}
err = settings.PutAreDevToolsEnabled(debugMode)
err = settings.PutAreDevToolsEnabled(debugMode || w.parent.options.DevToolsEnabled)
if err != nil {
globalApplication.fatal(err.Error())
}