From d5c986df8e53ea74096e737d63189f4c3e6d0788 Mon Sep 17 00:00:00 2001 From: Pedro de Oliveira Guedes Date: Tue, 28 Dec 2021 12:49:57 -0300 Subject: [PATCH] Fixing chromeSend. --- api/chrome/cli.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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) {