Skip to content

Instantly share code, notes, and snippets.

@arabindadora
Created May 3, 2020 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arabindadora/c042091c9296cee8567dc723bb914bfe to your computer and use it in GitHub Desktop.
Save arabindadora/c042091c9296cee8567dc723bb914bfe to your computer and use it in GitHub Desktop.
Extract Chrome tabs from Android
/**
* @author nullv01d
* Purpose: Extract Google Chrome tabs from an Android device
* Tested on: Google Chrome 81 on Computer
* Steps:
* 1. Enable USB debugging on your Android device and connect it with the computer
* 2. Open Google Chrome on the computer and goto chrome://inspect/#devices
* 3. Make sure "Discover USB devices" is enabled
* 4. The Android device's name and Chrome tabs' names and links should appear
* 5. Open a Chrome DevTools Console and run the code below
* 6. Paste the clipboard content to a .html file
* 7. Open the .html file in a browser and Viola!
*/
let bookmarks = Array.from(
document.querySelectorAll("#devices-list .list.pages .subrow")
).map((e) => {
let title = e.querySelector("div.name").innerText;
let url = e.querySelector("div.url").innerText;
return `<a href="${url}">${title}</a><br/>`;
});
copy("<html><body>" + bookmarks.join("\n") + "</body></html>");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment