Whenever I browse on my mobile I often open an interesting pages in Chrome and leave it for later. Usually the later never comes so I ended up with...
For further actions, you may consider blocking this person and/or reporting abuse
Also, a simple
tr
helps and removes"
curl http://localhost:9222/json/list | jq .[].url | tr -d '"' > mobile.tabs.txt
For those of you who have more than one instance of chrome running on your Android and
./adb forward tcp:9222 localabstract:chrome_devtools_remote
shows you the wrong one, you may need to find the process of the other instance like this:First I disabled the undesired chrome app (the one of my work profile, in my case), then,
adb shell "cat /proc/net/unix"
(I wasn't able to grep that, because it's binary or something like that, I had to copy the output into a text editor and find "chrome_devtools_remote") in order to find the instance that was named: localabstract:chrome_devtools_remote_31723 in my case.then:
./adb forward tcp:9222 localabstract:chrome_devtools_remote_31723
worked like a charm.Thanks for this awesome trick!
Awsome! Thanks for the tip, I will update the post with it.
THANK YOU!! I have wanted to clean this up for a long time, but as you are well aware, when one ends up in this situation, there are no easy options to clean it up. In my case, it got so bad that I could not even open the tab navigation anymore because it would cause Chrome to freeze and eventually crash. I could use the browser just fine (with some delay to initially open the browser), it was just difficult to switch tabs. I could only swipe left or right on the address bar to move to the adjacent tab, being careful not to swipe down because this would open the tab browser and crash. I had no idea how many tabs were open, and I also had no way to close tabs (!) because this can only be done from within the tab browser (or the Chrome Remote API, as I just learned today). As it turns out, I had about 7700 tabs open! Now the URLs are safely stored in an Excel sheet where I can sort/organize/bookmark/etc.
I am actually kind of amazed how well Chrome for Android was able to cope with this situation even as it got so ridiculously out of control. I was afraid one day the tab set would get completely corrupted and everything would be wiped out. This never happened.
In contrast, my secondary (work) phone is an iPhone 7 and it was in a similar situation but far less severe (maybe 200 tabs open). When Chrome crashed there, upon re-opening Chrome after the crash, it displayed a message for about 3 seconds that said "Chrome had a problem. Restore tabs?". If you did not click that restore button within those 3 seconds, the tabs were unrecoverably lost. I'm sure that even if I wanted to, I would not have been able to do a trick like this on the iPhone to back up my tabs. It was a completely hopeless situation, and that experience reinforces my preference to never voluntarily use an Apple product.
Next on the todo list is to adjust my habits so I don't end up in this situation again. This was an incredibly helpful first step on the road to recovery :)
Yeah, once my accidentally vertical swipes turned into minutes of relaunching Chrome I started using Incognito tabs and bookmarking religiously. But I thought 732 tabs was a lot, and here you and the topic creator are pushing the multiple THOUSANDS! Color me impressed. And grateful to have found this guide!
Funnily enough, the much despised grid view Chrome pushed out actually helped me close more tabs in the past few months, since I could group them and then have subtabs with an accessible X button. And viewing the clustered groups actually worked better and didn't crash the app (as often).
But I concur, better browsing habits are a must for us digital hoarders.
Thanks for this great step-by-step tutorial Marcin! I had sometimes about 70~90 tabs opened and, yes indeed, this can definitely be useful for cleaning them up (if you are sure you will read those URLs later). I now try to save interesting URLs to Pocket and read them offline when I have time, but still your trick can be helpful when we are in this kind of situation (especially with ~2500 opened tabs!).
Glad that I could help. I'm curious why Chrome developers excluded the "Bookmark All Tabs" feature from mobile version, it would be useful so much.
Thanks a lot! This really helped me :-) I just made a small modification:
To parse the JSON and save it to a Markdown file (with titles and urls):
How to make it URL clickable with a href and title to html file so i can import or click them?
what is wrong here?
curl localhost:9222/json/list | jq -r ".[] | \"(<a href="" + .url + \")">[\" + .title + \"]\"" > mobile.tabs.html
As a dev I understand the go-to method of writing code to solve a problem. The only issue here is that Chrome has a built-in way to do the same thing. This way does have 1 drawback, and that is it will open all the tabs on your computer first before you can bookmark them.
No code option.
This only works with recently-accessed tabs. It will not actually get ALL of the tabs that are currently open on the device, only maybe the last 50. So this "no code" option is not adequate. There is NO built-in way to do this properly; dev tools are the only way, and this is still true 1.5 years after you wrote this comment.
Thanks. This is a good option too as long as you have your mobile Chrome tabs synchronized with Google account. Also, not sure how Chrome desktop browser would handle over 2000 open tabs.
Theres only 5 tabs. I have million open. You didnt help.
I'm glad there's some way to do this, but it's insane that it has to be this hard. It's a common issue — why can't the Chrome developers add an option for it?
I'd like to know it as well.
As someone who has never been adventurous enough to use Linux I still lament the shift away from user control and customizable options that the smartphone revolution has brought us. I swear there are about a dozen features in each major app that exist as total headscratchers or have been ignored (or worse, removed) over the years.
Marcin, THANK YOU!! This is so handy and solve my issue :)
Besides, I found that I have to add quotation marks for jq to make it work, FYI !
Would this work on a phone that wouldn't turn on? I'm currently getting an error "Your phone couldn't start normally. Some configuration data may be corrupt" so I'm trying to access all the tabs and groups I had open on Chrome. I believe I already had Developer's Mode on before this happened but I don't know if it was turned off when the phone updated to Android 11.
Phone is a Samsung A20 in case that's relevant.
I have no idea, but maybe if you manage to boot in safe mode.
Yeah I got it to boot into Safe Mode today through the "Erase App Data" option for the error, but it ended up losing all the tabs.
It's best! but I have two spaces in my xiaomi phone and if I debugging first space all were done, but if I'm in second space, desktop chrome writes me error - webpage is not available and something like server is busy...in this second space I like to debugging because I have approximately 20000 tabs opened.. and what I have to do? Maybe I haven't enought buffer? Help!!
Have you tried the trick with disabling one application (one space)? I've just added some more screens to the description.
Thanks so much
So when i got mobile-tabs.json
superuser.com/a/1469296/64599
then i in excel removed other json collums.
Then in convertcsv.com/html-links-to-csv.htm
made step4 custom {f1}{br} and button click
Then exporting
Importing as bookmarks in chrome.
But easyer would be if this could be helped to fix dev.to/kangarooo/comment/1m776
somehow i always get :(
Can you check in browser on PC when you mapped port using
adb
command from the post: localhost:9222/json/list ?Looks like you did not get the JSON from this address.
Hey, thanks for the reply.
it looks like my issue was related to powershell. i need to add
Select Content -Expand Content
which ended up like thisplatform-tools>curl 'localhost:9222/json/list' | Select Content -Expand Content | jq.exe .[].url > mobile.tabs.txt
'Select' is not recognized as an internal or external command,
operable program or batch file.
Dzieki Marcin!
Just what I needed to move my open tabs from my phone to the desktop!
You welcome :)
I put off clearing my tabs for the last five years. I only had 732 open, but that is because, like others said, trying to look at them crashed Chrome. So I would use Incognito mode to avoid dealing with that.
Thank you so much for having these instructions up! My phone (Galaxy S7) finally bit the dust, and I can only have it powered on for minutes at a time. I never got around to backups, so I've been frantically copying all I can while the short windows of up time (which last longer when the phone is colder, go figure) permit me to do so.
I'm sorry to say that despite having a CS degree, I have zero skill with cmd anymore, and your instructions, while surely obvious to somebody with an ounce of awareness, took me about 5 hours to implement. (It didn't help that I misunderstood your instructions regarding bash and installed Ubuntu on my Windows in a shell, ugh.)
But once I learned how to use the command line all over again, I was able to pull that json list up just long enough to copy it!
I hope more people find this page, and more importantly I hope the Chrome devs get a clue and allow us to bookmark all our mobile tabs in a future update. Doubtful, as a day's worth of googling plus years of prior attempts have proven, but I know on PC I do the bookmark and move on thing far more often. Or so I say as I have 2 Chrome accounts open with 100 combined tabs, lol. Most of my bookmark folders are some variant of "Open September 1 2021" ha ha. (That's another feature Chrome on mobile needs, the ability to bookmark something multiple times so it can be in several folders at once!)
Again, thanks a ton for this guide and providing the only realistic solution to the tab hoarder's dilemma. Now to figure out how to regex my json list into an importable bookmarks file. Wish me and my rusty skills good luck!
Hello. This is what I was looking for. Thanks. But I have Chrome installed on my Android phone and Brave browser (?id=com.brave.browser) which is also based on Chrome. I applied your instructions step by step but it exported Brave browser's tabs. not Chrome's. How can I export chrome tabs?
Hmmm.. Not sure what is happening. Can you also try these steps: developers.google.com/web/tools/ch...
Or you could try force shutting down Brave and see if that halped.
By the way, there's an issue on the Chromium issue tracker bugs.chromium.org/p/chromium/issue... 😊
Cool, assigned to sb. on 13 March. Looking forward tot have it.
Any ideas on where I can share the issue?
des... is more likely to implement it with more stars! :) btw sb hasn't been on Chromium Bugs in over a year. They probably stopped working there.
edit 1: disregard, it still works!
edit 2: here was the bugtracker ticket I was thinking of bugs.chromium.org/p/chromium/issue...
Is this still possible? Running adb shell "cat /proc/net/unix" shows no output with localabstract:chrome_devtools_remote anymore. From memory, I believe someone brought this up on the Chromium bugtracker and this has been deprecated post v100 versions of Chrome but I can't find it on the tracker.I have no idea how to do this. where do i even need to type these commands? I am on windows 10
Thank you for this article, very useful.
Also I found
jq map({title, url})
much better to fit my purposes :)platform-tools>curl localhost:9222/json/list | jq map({title, url}) > 12.html
% Total % Received % Xferd Average Speed Tjq: error: syntax error, unexpected $end (Windows cmd shell quoting issues?) at , line 1:
map({title,
ijq: 1 compile error
me Time Time Current
Dload Upload Total Spent Left Speed
40 244k 40 99k 0 0 99k 0 0:00:02 --:--:-- 0:00:02 278k
curl: (23) Failed writing body (0 != 16384)
Thanks! Pretty useful. :D
Thank you Marcin, using your method modified to work on a Windows PC was able to get the result.
Only Will Wang's syntax below worked for me to get the list at the end :-)
curl localhost:9222/json/list | jq '.[].url' > mobiletabs.txt
Found I had 4887 tabs open!
Hi thanks man this helped lot
C:\Users\User\platform-tools>adb forward tcp:9222 localabstract:chrome_devtools_remote
It give back info
9222
Localhost still not working localhost:9222/
Android 7.0
Where can I see how many tabs are opened on my android device? I want to check it before I try this method.
chrome.google.com/sync
At the bottom should be a section tallying the stored (but inaccessible via any reasonable means) tabs.
"Open tabs
Tabs that are currently open in Chrome on one of your devices."
Will this tip works with Opera (on Android)?
What modification of commands needs?
How does one "install" JQ? I downloaded it, ran it but nothing happens. Do I need to add it to PATH? Sorry for asking, I just have no experience with these thing.