-
Notifications
You must be signed in to change notification settings - Fork 57
Spelunking Fraidycat's Save Files
This came up in #220:
My question: is it possible to inspect (and maybe even edit) the extension's synced feed list somewhere in Chrome, either using the JS console or some other tool? If anyone can point me in the right direction for spelunking, I'd be happy to investigate (and report back, if desired).
Yeah sure! Here's some knowledge.
First off, let me just list all the files used by Fraidycat.
In local storage (storage.local
), we have:
-
/follows.json
: The master list of all the follows on this browser. Includes the most recent posts as well and the stats for the graphs. This file is kept in memory the whole time, so changing this file will not do a whole lot. It gets overwritten quite a lot. -
/feeds/neocities.org-8e00f075.json
: Each follows has a file that stores a full post history and all of the details. The name of the file is/feeds/domain.com-hash.json
- the same ID used in the URL of the 'edit' page for that follow. -
/social.json
: This is just a personal copy of the instructions at https://fraidyc.at/defs/social.json, in case the website is down. -
fraidycat
: Just a list of when each follow was last fetched.
And in sync storage (storage.sync
), we have:
-
/follows/0
...follows/999
: These are sections of the follow.json (very stripped down) to indicate when a follow is added or deleted. This is how the sync happens. These files are split up to get around file size restrictions on sync content.
In Chrome, you can inspect the extension by visiting the chrome://extensions page. Find the little Fraidycat box on that page and click 'background page'. This should bring up a window with a JavaScript console.
You know you're in the right place if this command brings up all your follows:
chrome.storage.local.get(console.log)
in Firefox, you instead visit this page: about:debugging#/runtime/this-firefox. Find the little Fraidycat box on this page and click the big 'Inspect' button. This should bring up a tab with a JavaScript console.
The command to see all your follows here is:
browser.storage.local.get(console.log)
Just to give you a bit more to go on, you can look into the contents of a specific file using this command in Chrome:
chrome.storage.local.get(['/follows.json'], o => console.log(JSON.parse(Object.values(o).pop())))
(Using the name of the file in place of '/follows.json'
. The object inside the file will show up in the console.)
For Firefox, use:
browser.storage.local.get(['/follows.json'], o => console.log(JSON.parse(Object.values(o).pop())))