Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert json formatted Chrome bookmark file into html

How can I convert json formatted bookmarks file (taken from /Library/Application Support/Google/Chrome/Default/Bookmarks) into an bookmarks html file so Google Chrome can import it?

like image 838
Dmitry Avatar asked Dec 02 '15 18:12

Dmitry


People also ask

How do I export bookmarks from Chrome JSON?

Save Chrome history and bookmarks as JSON files. Click on 'Chrome History. json' or 'Chrome Bookmarks. json' button to download JSON file with your browser history/bookmarks.

How do I export bookmarks from JSON?

In the toolbar at the top, click the dropdown menu labeled “import and backup.” You will see a list of options for importing, exporting, backing up and restoring your bookmarks. Click the “backup” button. In the next window, select a folder to save your JSON file in and click “save.”


2 Answers

If for whatever reason, you only have the JSON output of the Chrome bookmarks file, don't sweat it. Chrome will export bookmarks as HTML and import as HTML. But, sometimes you don't have the luxury of exporting from Chrome because of some issue with your Windows installation. But, you're resourceful and managed to at least get access to your Windows filesystem and backed up your Chrome bookmarks file. But, now how do you import it to Chrome on a working computer without it being in HTML format?

On Windows (this was tested on Win 10), all you have to do is Show Hidden Files and Folders and then paste and overwrite the Bookmarks file at:

C:\Users\YourUserName\AppData\Local\Google\Chrome\User Data\Default

Don't run around in circles trying to convert JSON to HTML if you have a Windows computer. I'm not sure about Mac and Linux, but I'd bet it would work similarly.

like image 169
Amit L. Avatar answered Sep 16 '22 15:09

Amit L.


This has more or less been answered in comments by @Mr.P, but let me formalise:

In my example I have a current (OS root) drive called C:\\. I have a storage drive of F:\\ which has a previous install of Chrome on it which I want to retrieve the bookmarks from.

I did this in Powershell but you could easily do it in file explorer you would just need to either enter the path to <drive_name>:\\users\<account_name>\appdata manually/show hidden folders.

  1. close all instances of Chrome currently running (maybe check in the process monitor to ensure all processes terminated).

  2. navigate to <storage_drive_letter>:\\users\<account_name>\appdata\local\google\chrome\default.

  3. On PowerShell you would select the previous install bookmarks file by entering $books = Get-Item bookmarks. On file explorer you would 'cut'

  4. cd <os_drive_letter>:\\users\<account_name>\appdata\local\google\chrome\default or navigate to this path on file explorer

  5. mv $books . or paste file

  6. open up Chrome again and check the bookmarks: they should be visible all together.

  7. [optional] If you're brave close all Chrome windows once again (potentially save both files somewhere else before you do this) delete all files with 'bookmarks' at the start (you can use gci | where {$_.name -like "bookmarks"} | rm) then reopen the browser. In your filesystem Chrome should have automatically regenerated the bookmarks into one file.

If this doesn't work for other people let me know

like image 42
Scott Anderson Avatar answered Sep 18 '22 15:09

Scott Anderson