Applescripts to save all tab titles and URLs, in a web browser on macOS, to a Markdown text file on the Desktop. *Not* a web extension: good for the privacy conscious.
Activate Safari > File > Export Bookmarks... manually to start, then add it as an automated step before I...
Parse the exported bookmarks HTML file (likely via an external Python script... or perhaps this is the opportunity to look at JXA), then export bookmark title and URLs in the same format as the macOS browser scripts.
Also need to declare tab bankruptcy on my phone Safari... so am thinking about the best way to do it.
A quick search suggests the best option, courtesy of @joshdance with this StackExchange answer:
The problem with step 2 is that the links are now in a note and not a file, but worse is that it only saves the URLs and not the titles.
So I propose to replace it with:
Comments or alternative suggestions welcome.