The Great SuspenderでサスペンドしていたURLをjsonで出力する

ということで削除されちゃったんですね.
自分は先月怪しいという話を聞いて削除していました.その時タブが消えてしまい悲しかったのですがこんな感じで復旧させました.
タイムスタンプとタイトル,URLをjsonで出力します.

$ sqlite3 ~/.config/google-chrome/Default/History "SELECT \"[\" || group_concat(json_object('timestamp', last_visit_time, title, url)) || \"]\" FROM urls WHERE url LIKE '%bkeccnjlkjkiokjodocebajanakg%';" | jq . | sed -e 's/chrome-extension:\/\/klbibkeccnjlkjkiokjodocebajanakg\/suspended.html.*&uri=//'

何をやっているかというと, ~/.config/google-chrome/Default/History がGoogle Chromeのsqlite3形式の履歴ファイルなので,この中からThe Great Suspenderのurlの含まれているurlを引っ張り出して整形しています.

Chromiumの場合は ~/.config/chromium/Default/History
Braveは ~/.config/BraveSoftware/Brave-Browser/Default/History でした.

Default以外のprofileは名前いろいろなのでfindとかで探すといいでしょう.

$ find ~/.config/chromium/ ~/.config/google-chrome/ ~/.config/BraveSoftware/Brave-Browser -name History

ここで紹介したのはLinuxでの場合ですが,パスを変えると他のOSでもいけるはずです.

環境1
$ dpkg-query -W jq sqlite3 chromium google-chrome-stable
chromium
google-chrome-stable    69.0.3497.100-1
jq      1.6-2.1ubuntu1
sqlite3 3.34.0-1
$ lsb_release -dr
Description:    Ubuntu Hirsute Hippo (development branch)
Release:        21.04
$ uname -m
x86_64
環境2
$ dpkg-query -W jq sqlite3 chrome brave-browser google-chrome-stable
brave-browser   1.19.90
google-chrome-stable    88.0.4324.146-1
jq      1.6-2.1
sqlite3 3.34.1-1
$ lsb_release -dr
Description:    Debian GNU/Linux bullseye/sid
Release:        unstable
$ uname -m
x86_64

コメントを残す

メールアドレスが公開されることはありません。 ※ が付いている欄は必須項目です

Your post must include a link to this post.

How does this work?
Write a response on your own website and include a link to this post. Then submit your response’s URL here. Your response may appear here after moderation. To update or remove it, edit or delete your original post and submit the same URL again. Learn more about Webmentions.