machinateur / android-chrome-tab-transfer

A tool to transfer google chrome tabs from your android phone to your computer using `adb`.
MIT License
91 stars 10 forks source link

Unable to download tabs from device! #9

Closed ethankcvds closed 1 year ago

ethankcvds commented 2 years ago

The adb executable is available. Running adb command...

adb -d forward tcp:9222 localabstract:chrome_devtools_remote

  • daemon not running; starting now at tcp:5037
  • daemon started successfully 9222 Downloading tabs from device... http://localhost:9222/json/list Unable to download tabs from device! Please check the device connection! Also make sure google chrome is running on the connected device.

Phone is a Motorola g play. USB debug is enabled on the phone and adb can connect to the phone. Chrome is open and running. When I open http://localhost:9222/json/list it shows every tab that is open.

machinateur commented 2 years ago

Hmm.. This is very odd. Especially the part where you can access the list via the browser. That implies the adb command and the connection are fine.

Does the error message appear immediately? I'm asking this, because the current timeout of the download is set to 10 seconds, which might be too short for some situations, where there are many tabs.

How long does it take the browser to fully load the list (e.g. until the loading icon is gone)? That might also be an indicator.

ethankcvds commented 2 years ago

The error message appeared within in a few seconds after the Downloading tabs message.

It didn't take very long for either of the browsers I tried to load the page maybe 2-3 seconds to load.

ethankcvds commented 2 years ago

Managed to get it working. Was using PHP version 7.4.26 tried going up to 7.4.30 wasn't working either. Tried 8.1.7 and it exported the open tabs.

machinateur commented 2 years ago

I'll try to reproduce this problem tomorrow.

machinateur commented 1 year ago

Sorry for the wait. Was a bit longer than expected... A lot of tomorrows since :)

I could really not make this work. What's especially strange: It initially worked for me without a problem (under PHP 8). That was back before the initial release.

I first thought this might be related to the PHP version, but it still didn't work. I've changed devices since, so it could very well be something that different from device to device.

I've tried for wait-time, in case the socket forwarding couldn't be established in time for the HTTP request to hit, but that didn't do the trick.

I now suspect that the function used for download is not equipped to handle some non-standard element of the communication. I left it at that.

So I ended up by moving from the native, wrapper based file_get_contents() call to a curl based approach, which up to now worked in any version or with any of the devices I tried.

The release incorporating that change is available here (v0.4.0).

If you're still interested, please feel free to test your scenario again with the new version.

ethankcvds commented 1 year ago

I tested v0.4.1 and it is working.