Skip to content

Instantly share code, notes, and snippets.

@benjaminaaron
Created March 20, 2022 10:38
Show Gist options
  • Save benjaminaaron/98055bdd2ab0b83ca173b7609227f884 to your computer and use it in GitHub Desktop.
Save benjaminaaron/98055bdd2ab0b83ca173b7609227f884 to your computer and use it in GitHub Desktop.
JS code for the chrome developer console to extract a CSV file from "Tabs from other devices" in chrome://history/syncedTabs
// To access the list-element within shadowroot I clicked inspect on the list and right-clicked on <div id="tab-item-list">
// --> "Store as global variable", this gives you temp1 that is the basis for this cript
// There are probably better ways to access elements in shadowroot, but I didn't want to take the time to learn about it at this point :)
items = temp1.getElementsByClassName("item-container")
for (i = 0; i < items.length; i++) {
item = items[i].firstChild;
line = '"' + item.title.replace(/['"]+/g, '') + '","' + item.href + '"';
setTimeout (console.log.bind (console, line));
}
// And then right-click in the console and "Save as...", remove the for-loop code on top of the file and rename it to CSV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment