dzentota / chrome-dev-tools

This is a PHP lib that allows one to interact with Google Chrome using Chrome DevTools Protocol within a PHP script. Highly inspired by marty90/PyChromeDevTools
MIT License
11 stars 6 forks source link

Update is needed #4

Open oleg-milantiev opened 1 year ago

oleg-milantiev commented 1 year ago

Hi!

This version didn't work with current Chrome :( Sorry for ask, but could you update this perfect look library to use actual Chrome? 🥇

Thanks a lot!

oleg-milantiev commented 1 year ago

this minor fix helps me:

> composer.json
-        "textalk/websocket": "1.0.*"
+        "textalk/websocket": "^1.6"

> examples/page_loading_time.php
-$chrome = new Chrome();
+$chrome = new Chrome(); # local
+$chrome = new Chrome('http://172.20.0.2', 9222); # remote

> src/Chrome.php
-        $endpoint = sprintf('http://%s:%s/json', $this->host, $this->port);
+        $endpoint = sprintf('%s:%s/json', $this->host, $this->port);
+        curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']