Created
September 2, 2019 09:21
-
-
Save akkys77/f14f13ffd9d61c61c24ab383d0180524 to your computer and use it in GitHub Desktop.
Export open tabs from android pixel phone in History tabs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var nodeArrays = document.querySelector('#history-app').shadowRoot.querySelector('#synced-devices').shadowRoot.querySelector('#synced-device-list > history-synced-device-card:nth-child(1)').shadowRoot.querySelectorAll('#tab-item-list > div > a') | |
| itemsArray = [...nodeArrays] | |
| var i,j,temparray,chunk = 25, result=[], tempWindow=""; | |
| for (i=0,j=itemsArray.length; i<j; i+=chunk) { | |
| temparray = itemsArray.map(el =>({url:el.href,hostname:el.hostname,title:el.title})).slice(i,i+chunk); | |
| tempWindow = {title:'Window '+i/25,tabs:temparray}; | |
| result=[...result, tempWindow] | |
| } | |
| JSON.stringify(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment