Skip to content

chrome.Browser.Socket.Page.Enable

Michael Kenney edited this page Sep 29, 2018 · 1 revision

Enable page events for a tab. This is important as until they are explicitly enabled none of the Page events will be delivered to the devtools websocket. This is also true of various other functionality in Chrome. See the documentation for details.

package main

import (
	chrome "github.com/mkenney/go-chrome/tot"
)

func main() {
	var err error

	// ... snip ... //

	// Enable Page events for this tab
	if enableResult := <-tab.Page().Enable(); nil != enableResult.Err {
		panic(enableResult.Err.Error())
	}
}