Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-opening tabs on Windows #18

Closed
HeyItsJono opened this issue Feb 22, 2023 · 1 comment
Closed

Re-opening tabs on Windows #18

HeyItsJono opened this issue Feb 22, 2023 · 1 comment

Comments

@HeyItsJono
Copy link

HeyItsJono commented Feb 22, 2023

I just wanted to flag that it's possible to repurpose the generated tabs-reopen.sh script for use on Windows without WSL. The only prerequisite is that the user has access to curl via the Windows commandline, this can be installed quite easily with Scoop, which is sort of like a package manager for Windows.

With curl installed, the steps to convert tabs-reopen.sh to work on Windows are as follows:

  1. Rename tabs-reopen.sh to tabs-reopen.cmd
  2. Open tabs.reopen.cmd in Notepad
  3. Go to Edit -> Replace (or alternatively press Ctrl+H to bring it up)
  4. Replace # with :: and click Replace All (converts bash comments to batch comments)
  5. Replace % with %% and click Replace All (batch files require all % to be escaped with another %)
  6. Replace ' with " and click Replace All (all URLs must be double-quoted to work with curl, and double-quotes also escape other batch characters)
  7. Save then run tabs-reopen.cmd with Chrome open on your phone and connected via USB (may need to re-forward with adb -d forward tcp:9222 localabstract:chrome_devtools_remote first).

If there's an error within the URL (e.g. something isn't escaped properly), it'll manifest as opening an about:blank page. For this purpose you may find it useful to redirect all output from tabs-reopen to a logfile so you can Ctrl+F through and ensure this hasn't happened. This can be done with tabs-reopen.cmd > reopen.log 2>&1 from the commandline.

If you want each page to load a bit before opening the next tab so that you get the titles displayed in the open tabs view, then you can put a sleep command between each curl line. I'm using powershell -nop -c "& {sleep 5}" to wait 5secs between each tab open.

Thanks to this and your tool I managed to get my cripplingly large tab collection back on my new phone (>1100 tabs lmao help).

@machinateur
Copy link
Owner

Thanks for the description of how to achive this. I didn't really bother with making a Powershell compatible script, when I made this tool.

As this description should be helpful to most others, who use the script on windows, I will link to it in the readme.

I know the struggle large amounts of tabs can be, yet I haven't tried pulling >300 tabs. Good to know it can handle more than 1k just fine, and I'm happy the tool could be of use to you.

Best regards
machinateur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants