Skip to content

Instantly share code, notes, and snippets.

@u1735067
Created January 5, 2020 20:04
Show Gist options
  • Save u1735067/64f3a5136d7ddb177853db0d726a013e to your computer and use it in GitHub Desktop.
Save u1735067/64f3a5136d7ddb177853db0d726a013e to your computer and use it in GitHub Desktop.
Script to extract opened tabs from Android (Chromium-based browsers)
@echo off
:: https://android.stackexchange.com/questions/56635/how-can-i-export-the-list-of-open-chrome-tabs
echo Waiting for device ..
Z:\Dev\Android\adb.exe wait-for-device
echo Connected to device, open Chrome and wait a bit
pause
Z:\Dev\Android\adb.exe forward tcp:9222 localabstract:chrome_devtools_remote
chcp 65001 > nul
Z:\Utils\curl.exe -s http://127.0.0.1:9222/json/list | Z:\Utils\jq.exe -r "sort_by(.id) | .[] | ""-" [\(if (.title ^| length) ^> 0 then .title ^| gsub(""^'""";"""'""")" else .url end)](\(.url))"""
Z:\Dev\Android\adb.exe kill-server
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment