func (ch *Chrome) broadMsgs(m Message) {
	lc, ok := ch.listeners[m.Method]
	if !ok {
		return
	}
	for c := range lc {
		lc[c] <- m
	}
}
Runs in its own goroutine, to brodacst msgs
package gochrome
import (
	"encoding/json"
	"errors"
	"fmt"
	"io/ioutil"
	"net/http"
	"github.com/gorilla/websocket"
)
var TabNotFound = errors.New("Tab not found")
type Command struct {
	Id     int        `json:"id"`
	Method string     `json:"method"`
	Params Parameters `json:"params"`
}
type Parameters map[string]interface{}
type gtab struct {
	Description          string `json:"description"`
	DevtoolsFrontendUrl  string `json:"devtoolsFrontendUrl"`
	FaviconUrl           string `json:"faviconUrl"`
	Id                   string `json:"id"`
	Title                string `json:"title"`
	Type                 string `json:"type"`
	Url                  string `json:"url"`
	WebSocketDebuggerUrl string `json:"webSocketDebuggerUrl"`
}
type Chrome struct {
	c         *websocket.Conn
	listeners map[string][]chan Message
}
type Message struct {
	Method string `json:"method"`
	Params map[string]interface{}
}
type Result struct {
	Id     int                    `json:"id"`
	Error  map[string]interface{} `json:"error"`
	Result map[string]interface{} `json:"result"`
}
func New(url string, tab int) (*Chrome, error) {
	url, err := getTab(url, tab)
	c, err := newClient(url)
	if err != nil {
		return nil, err
	}
	ch := &Chrome{c, make(map[string][]chan Message, 0)}
	go ch.readMessages()
	return ch, err
}
func (ch *Chrome) Send(co Command) error {
	message, err := json.Marshal(co)
	if err != nil {
		return err
	}
	err = ch.c.WriteMessage(1, message)
	return err
}
func (ch *Chrome) readMessages() {
	for {
		_, r, err := ch.c.ReadMessage()
		if err != nil {
			continue
		}
		m := Message{}
		err = json.Unmarshal(r, &m)
		if err != nil {
			fmt.Println(err)
			continue
		}
		go ch.broadMsgs(m)
	}
}