mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-15 15:15:51 +01:00
* custom transport initial * transport codecs * runtime set transport * events transport * clauded example * bundled runtime * wip: transport * rework transports * rework dialog responses * cleanup * cleanup * improve error handling in HTTPTransport * cleanup * cleanup * cleanup * cleanup * review changes * review changes * review changes * review changes * review changes * review changes * review changes * move documentation to website docs * update doc * update changelog * introduce JSClient method for transport for embedding JS part in transport --------- Co-authored-by: Atterpac <Capretta.Michael@gmail.com> Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
20 lines
386 B
Go
20 lines
386 B
Go
package runtime
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
var runtimeInit = `window._wails=window._wails||{};window.wails=window.wails||{};`
|
|
|
|
func Core(flags map[string]any) string {
|
|
flagsStr := ""
|
|
if len(flags) > 0 {
|
|
f, err := json.Marshal(flags)
|
|
if err == nil {
|
|
flagsStr += fmt.Sprintf("window._wails.flags=%s;", f)
|
|
}
|
|
}
|
|
|
|
return runtimeInit + flagsStr + invoke + environment
|
|
}
|