Fixing bad merge from last commit

This commit is contained in:
Kenneth Shaw 2017-02-22 20:57:02 +07:00
parent 35dfe7af26
commit 320373de1a

8
nav.go
View File

@ -41,7 +41,8 @@ func NavigateToHistoryEntry(entryID int64) Action {
} }
// NavigateBack navigates the current frame backwards in its history. // NavigateBack navigates the current frame backwards in its history.
func NavigateBack(ctxt context.Context, h cdp.Handler) error { func NavigateBack() Action {
return ActionFunc(func(ctxt context.Context, h cdp.Handler) error {
cur, entries, err := page.GetNavigationHistory().Do(ctxt, h) cur, entries, err := page.GetNavigationHistory().Do(ctxt, h)
if err != nil { if err != nil {
return err return err
@ -52,10 +53,12 @@ func NavigateBack(ctxt context.Context, h cdp.Handler) error {
} }
return page.NavigateToHistoryEntry(entries[cur-1].ID).Do(ctxt, h) return page.NavigateToHistoryEntry(entries[cur-1].ID).Do(ctxt, h)
})
} }
// NavigateForward navigates the current frame forwards in its history. // NavigateForward navigates the current frame forwards in its history.
func NavigateForward(ctxt context.Context, h cdp.Handler) error { func NavigateForward() Action {
return ActionFunc(func(ctxt context.Context, h cdp.Handler) error {
cur, entries, err := page.GetNavigationHistory().Do(ctxt, h) cur, entries, err := page.GetNavigationHistory().Do(ctxt, h)
if err != nil { if err != nil {
return err return err
@ -66,6 +69,7 @@ func NavigateForward(ctxt context.Context, h cdp.Handler) error {
} }
return page.NavigateToHistoryEntry(entries[cur+1].ID).Do(ctxt, h) return page.NavigateToHistoryEntry(entries[cur+1].ID).Do(ctxt, h)
})
} }
// Stop stops all navigation and pending resource retrieval. // Stop stops all navigation and pending resource retrieval.