-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathraw_browserwindowproxy.go
30 lines (27 loc) · 1.07 KB
/
raw_browserwindowproxy.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package electron
import "github.com/gopherjs/gopherjs/js"
// BrowserWindowProxy [email protected]
//
// Manipulate the child browser window
type BrowserWindowProxy struct {
*js.Object
// A Boolean that is set to true after the child window gets closed.
Closed bool `js:"closed"`
// Removes focus from the child window.
Blur func() `js:"blur"`
// Forcefully closes the child window without calling its unload event.
Close func() `js:"close"`
// Evaluates the code in the child window.
Eval func(Code string) `js:"eval"`
// Focuses the child window (brings the window to front).
Focus func() `js:"focus"`
// Invokes the print dialog on the child window.
Print func() `js:"print"`
// Sends a message to the child window with the specified origin or * for no origin preference. In addition to these methods, the child window implements window.opener object with no properties and a single method.
PostMessage func(Message string, TargetOrigin string) `js:"postMessage"`
}
func WrapBrowserWindowProxy(o *js.Object) *BrowserWindowProxy {
return &BrowserWindowProxy{
Object: o,
}
}