- 
                Notifications
    You must be signed in to change notification settings 
- Fork 341
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 Consoletab
- 
Copy-paste following commands and press Enter, then expand the result: chrome.storage.local.get(["dbInChromeStorage", "dbInChromeStorageReason"], console.log) 
- 
If it says truethen you are usingchromeStorageDB, it may also come with a reason.If it says falsethen you are usingindexedDB.
- Open the style manager
- Open the devtool console by pressing F12
- Switch to the Applicationtab
- 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 Consoletab
- 
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 Consoletab
- 
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