mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
docs: sync documents (#2443)
Co-authored-by: misitebao <misitebao@users.noreply.github.com>
This commit is contained in:
co-authored by
misitebao
parent
e339c40e85
commit
4cd873fecb
@@ -71,6 +71,7 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
|
||||
| -windowsconsole | Keep the console window for Windows builds | |
|
||||
| -obfuscate | Obfuscate the application using [garble](https://github.com/burrowers/garble) | false |
|
||||
| -garbleargs | Arguments to pass to garble | `-literals -tiny -seed=random` |
|
||||
| -nosyncgomod | Do not sync go.mod with the Wails version | false |
|
||||
|
||||
For a detailed description of the `webview2` flag, please refer to the [Windows](../guides/windows.mdx) Guide.
|
||||
|
||||
@@ -80,8 +81,10 @@ Example:
|
||||
|
||||
`wails build -clean -o myproject.exe`
|
||||
|
||||
:::Info
|
||||
:::info
|
||||
|
||||
On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`.
|
||||
|
||||
:::
|
||||
|
||||
:::info UPX on Apple Silicon
|
||||
@@ -184,6 +187,9 @@ Your system is ready for Wails development!
|
||||
| -save | Saves the given `assetdir`, `reloaddirs`, `wailsjsdir`, `debounce`, `devserver` and `frontenddevserverurl` flags in `wails.json` to become the defaults for subsequent invocations. | |
|
||||
| -race | Build with Go's race detector | false |
|
||||
| -s | Skip building the frontend | false |
|
||||
| -nosyncgomod | Do not sync go.mod with the Wails version | false |
|
||||
|
||||
|
||||
|
||||
Example:
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ func main() {
|
||||
OnBeforeClose: app.beforeClose,
|
||||
CSSDragProperty: "--wails-draggable",
|
||||
CSSDragValue: "drag",
|
||||
EnableFraudulentWebsiteDetection: false,
|
||||
ZoomFactor: 1.0,
|
||||
IsZoomControlEnabled: false,
|
||||
Bind: []interface{}{
|
||||
@@ -77,7 +78,8 @@ func main() {
|
||||
// OnSuspend is called when Windows enters low power mode
|
||||
OnSuspend func()
|
||||
// OnResume is called when Windows resumes from low power mode
|
||||
OnResume func()
|
||||
OnResume func(),
|
||||
WebviewGpuDisabled: false,
|
||||
},
|
||||
Mac: &mac.Options{
|
||||
TitleBar: &mac.TitleBar{
|
||||
@@ -100,6 +102,7 @@ func main() {
|
||||
Linux: &linux.Options{
|
||||
Icon: icon,
|
||||
WindowIsTranslucent: false,
|
||||
WebviewGpuPolicy: linux.WebviewGpuPolicyAlways,
|
||||
},
|
||||
Debug: options.Debug{
|
||||
OpenInspectorOnStartup: false,
|
||||
@@ -232,11 +235,11 @@ Not all features of an `http.Request` are currently supported, please see the fo
|
||||
| DELETE | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Body | ✅ | ✅ | ❌ |
|
||||
| Request Body Streaming | ❌ | ❌ | ❌ |
|
||||
| Request Body Streaming | ✅ | ✅ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Body | ✅ | ✅ | ✅ |
|
||||
| Response Body Streaming | ❌ | ❌ | ✅ |
|
||||
| Response Body Streaming | ❌ | ✅ | ✅ |
|
||||
| WebSockets | ❌ | ❌ | ❌ |
|
||||
| HTTP Redirects 30x | ✅ | ❌ | ❌ |
|
||||
|
||||
@@ -356,6 +359,12 @@ Indicates what value the `CSSDragProperty` style should have to drag the window.
|
||||
|
||||
Name: CSSDragValue<br/> Type: `string`
|
||||
|
||||
### EnableFraudulentWebsiteDetection
|
||||
|
||||
EnableFraudulentWebsiteDetection enables scan services for fraudulent content, such as malware or phishing attempts. These services might send information from your app like URLs navigated to and possibly other content to cloud services of Apple and Microsoft.
|
||||
|
||||
Name: EnableFraudulentWebsiteDetection<br/> Type: `bool`
|
||||
|
||||
### ZoomFactor
|
||||
|
||||
Name: ZoomFactor<br/> Type: `float64`
|
||||
@@ -542,6 +551,12 @@ If set, this function will be called when Windows resumes from low power mode (s
|
||||
|
||||
Name: OnResume<br/> Type: `func()`
|
||||
|
||||
#### WebviewGpuIsDisabled
|
||||
|
||||
Setting this to `true` will disable GPU hardware acceleration for the webview.
|
||||
|
||||
Name: WebviewGpuIsDisabled<br/> Type: `bool`
|
||||
|
||||
### Mac
|
||||
|
||||
This defines [Mac specific options](#mac).
|
||||
@@ -722,6 +737,20 @@ Setting this to `true` will make the window background translucent. Some window
|
||||
|
||||
Name: WindowIsTranslucent<br/> Type: `bool`
|
||||
|
||||
#### WebviewGpuPolicy
|
||||
|
||||
This option is used for determining the webview's hardware acceleration policy.
|
||||
|
||||
Name: WebviewGpuPolicy<br/> Type: [`options.WebviewGpuPolicy`](#webviewgpupolicy-type)<br/> Default: `WebviewGpuPolicyAlways`
|
||||
|
||||
##### WebviewGpuPolicy type
|
||||
|
||||
| Value | Description |
|
||||
| ------------------------ | -------------------------------------------------------------------- |
|
||||
| WebviewGpuPolicyAlways | Hardware acceleration is always enabled |
|
||||
| WebviewGpuPolicyOnDemand | Hardware acceleration is enabled/disabled as request by web contents |
|
||||
| WebviewGpuPolicyNever | Hardware acceleration is always disabled |
|
||||
|
||||
### Debug
|
||||
|
||||
This defines [Debug specific options](#Debug) that apply to debug builds.
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
---
|
||||
sidebar_position: 8
|
||||
---
|
||||
|
||||
# Clipboard
|
||||
|
||||
This part of the runtime provides access to the operating system's clipboard.<br/> The current implementation only handles text.
|
||||
|
||||
### ClipboardGetText
|
||||
|
||||
This method reads the currently stored text from the clipboard.
|
||||
|
||||
Go: `ClipboardGetText(ctx context.Context) (string, error)`<br/> Returns: a string (if the clipboard is empty an empty string will be returned) or an error.
|
||||
|
||||
JS: `ClipboardGetText(): Promise<string>`<br/> Returns: a promise with a string result (if the clipboard is empty an empty string will be returned).
|
||||
|
||||
### ClipboardSetText
|
||||
|
||||
This method writes a text to the clipboard.
|
||||
|
||||
Go: `ClipboardSetText(ctx context.Context, text string) error`<br/> Returns: an error if there is any.
|
||||
|
||||
JS: `ClipboardSetText(text: string): Promise<boolean>`<br/> Returns: a promise with true result if the text was successfully set on the clipboard, false otherwise.
|
||||
@@ -34,4 +34,4 @@ Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optio
|
||||
|
||||
This method emits the given event. Optional data may be passed with the event. This will trigger any event listeners.
|
||||
|
||||
Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`<br/> JS: `EventsEmit(ctx context, optionalData function(optionalData?: any))`
|
||||
Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`<br/> JS: `EventsEmit(eventName: string, ...optionalData: any)`
|
||||
|
||||
@@ -14,6 +14,7 @@ sidebar_position: 1
|
||||
- [Events](events.mdx)
|
||||
- [Browser](browser.mdx)
|
||||
- [Log](log.mdx)
|
||||
- [Clipboard](clipboard.mdx)
|
||||
|
||||
Go 런타임은 `github.com/wailsapp/wails/v2/pkg/runtime` 가져오기를 통해 사용할 수 있습니다. 이 패키지의 모든 메소드는 컨텍스트를 첫 번째 매개변수로 사용합니다. 이 컨텍스트는 [OnStartup](../options.mdx#onstartup) 또는 [OnDomReady](../options.mdx#ondomready) 후크에서 가져와야 합니다.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user