-
Notifications
You must be signed in to change notification settings - Fork 305
How to Debug Database Issue
For historical reason, Stylus uses two databases to store your data. When one is down, it switches to the other one automatically. When this happens, you will find that all your styles disappeared.
-
Open the style manager
-
Open the devtool by pressing F12
-
Switch to the
Console
tab -
Copy-paste following commands and press Enter, then expand the result:
chrome.storage.local.get(["dbInChromeStorage", "dbInChromeStorageReason"], console.log)
-
If it says
true
then you are usingchromeStorageDB
, it may also come with a reason.If it says
false
then you are usingindexedDB
.
- Open the style manager
- Open the devtool console by pressing F12
- Switch to the
Application
tab - At the left panel, expand
IndexedDB
>stylish
>styles
If the database contains data:
- Open the style manager
- Open the storage panel by pressing Shift> + F9
- At the left panel, expand
Indexed DB
>moz-extension://...
>stylish (default)
>styles
If the database contains data:
-
Open the style manager
-
Open the devtool console by pressing F12
-
Switch to the
Console
tab -
Copy-paste the following command and press Enter:
chrome.storage.local.get(r => { console.log(Object.entries(r).map(([k, v]) => k.startsWith("style-") && v).filter(Boolean)); });
If the database contains data:
Sometimes your data are still there but you can't see it because the wrong database is activated. In this case, you just have to switch the database.
-
Open the style manager
-
Open the devtool by pressing F12
-
Switch to the
Console
tab -
Copy-paste the command and press Enter:
-
Switch to IndexedDB:
chrome.storage.local.set({dbInChromeStorage: false});
-
Switch to chromeStorageDB:
chrome.storage.local.set({dbInChromeStorage: true, dbInChromeStorageReason: "switched manually"});
-
-
Restart the browser