Skip to content
This repository has been archived by the owner on Feb 16, 2024. It is now read-only.

Commit

Permalink
Added get url
Browse files Browse the repository at this point in the history
  • Loading branch information
true-zero committed Apr 28, 2021
1 parent a2b9bf1 commit 793a155
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions window.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ const (
EventNameWindowCmdWebContentsExecuteJavaScript = "window.cmd.web.contents.execute.javascript"
EventNameWindowCmdWebContentsSetProxy = "window.cmd.web.contents.set.proxy"
EventNameWindowCmdWebContentsInterceptStringProtocol = "window.cmd.web.contents.intercept.string.protocol"
EventNameWindowCmdGetUrl = "window.cmd.get.url"
EventNameWindowCmdLoadURL = "window.cmd.load.url"
EventNameWindowEventBlur = "window.event.blur"
EventNameWindowEventClosed = "window.event.closed"
Expand All @@ -64,6 +65,7 @@ const (
EventNameWindowEventWillNavigate = "window.event.will.navigate"
EventNameWindowEventUpdatedCustomOptions = "window.event.updated.custom.options"
EventNameWindowLoadedURL = "window.event.loaded.url"
EventNameWindowGetUrl = "window.event.get.url"
)

// Title bar styles
Expand Down Expand Up @@ -597,3 +599,12 @@ func (w *Window) UpdateCustomOptions(o WindowCustomOptions) (err error) {
_, err = synchronousEvent(w.ctx, w, w.w, Event{WindowOptions: w.o, Name: EventNameWindowCmdUpdateCustomOptions, TargetID: w.id}, EventNameWindowEventUpdatedCustomOptions)
return
}

// Loads the url
func (w *Window) GetUrl() (e Event, err error) {
if err = w.ctx.Err(); err != nil {
return
}
e, err = synchronousEvent(w.ctx, w, w.w, Event{Name: EventNameWindowCmdGetUrl, TargetID: w.id}, EventNameWindowGetUrl)
return
}

0 comments on commit 793a155

Please sign in to comment.