diff --git a/api/chrome/cli.go b/api/chrome/cli.go index c73e328..f6a7e66 100644 --- a/api/chrome/cli.go +++ b/api/chrome/cli.go @@ -64,16 +64,16 @@ func (c *Cli) Wait(id string, s string, to int) (string, error) { json.Unmarshal(bs, &ret) return ret, err } -func (c *Cli) Send(id string, m string, ps map[string]interface{}) (string, error) { +func (c *Cli) Send(id string, m string, ps map[string]interface{}) (interface{}, error) { // id -> ID do Websocket no qual se deseja realizar a alteração. - ret := "" + var ret interface{} in := map[string]interface{}{ "method": m, "params": ps, } - err := c.HttpCli().JsonPost("/ipc/chrome/eval/"+id, in, &ret) + err := c.HttpCli().JsonPost("/ipc/chrome/send/"+id, in, &ret) return ret, err - // ret -> + // ret -> Retorno do comando (Referência em: https://chromedevtools.github.io/devtools-protocol/) } func (c *Cli) OpenTabs() (ret []map[string]string, err error) {