mozyのかきおき

mozyの読書感想文や思考置き場

数百とか開いているSafariのタブ情報をエクスポートする

経緯

つまりはこういうことだ
開きすぎる癖があって、これをどうにかしてCSVなりに書き出したかった

iPhoneのストレージも逼迫するし。

探していたところ

かみさーまー みたいな記事を発見した。BOOOM!!!

Ok!!! This has been SOLVED. For those who were wondering...

The post request to https://p58-ckdatabase.icloud.com/api/client/record/sync contained gzip-encoded information which made reference to SafariBookmarksSyncAgent.

SafariBookmarksSyncAgent is located at /System/Library/CoreServices/SafariSupport.bundle/Contents/MacOS/SafariBookmarksSyncAgent.

Ran strings on the binary and saw it made reference to: (allow file* (home-literal "/Library/Safari/CloudTabs.db"))

/Library/Safari/CloudTabs.db does not exist, but ~/Library/Safari/CloudTabs.db does!

CloudTabs.db is a SQLite3 database with table cloud_tabs and cloud_tab_devices.

select * from cloud_tab_devices gives the device_uuid in column 1.

select url from cloud_tabs where device_uuid='';

BOOM!

Reddit - mac - iPhone Safari Tabs into Text List via iCloud?

やってみた

今出先でPCがないため、家に戻ったら速攻やるぞ。