mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[v3] Add EnableDevTools option
This commit is contained in:
+23
-22
@@ -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
|
||||
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user