Repository navigation
[Help Request] Need Help Restoring/Opening Tampermonkey Scripts #2704
Replies: 4 comments
|
#2592 is the only starting point I can share for now |
|
Do you see storage data at the extension page debugger? https://stackoverflow.com/questions/67763573/firefox-extension-how-to-get-extension-storage-value |
|
When I click the Storage tab of the extension debugger, nothing happens. All the other tabs work, but clicking the Storage tab just continues displaying the content of whatever previous tab I was viewing. That other issue is what originally gave me the idea to delete the .sqlite file to see if that fixed TM (it did). I still have the '3647222921wleabcEoxlt-eengsairo.files' folder with its contents, and a session backup from before the BSOD. I was able to restore that session backup but it didn't change anything, TM was still broken. I wasn't sure where to go from there, so I decided to post my own issue. |
|
My IDB was corrupted when I created a new script that got picked up as malware by Windows Defender. Assuming you still have the IndexedDB database sqlite, the contents can be read and recovered. Use the script below to extract the scripts that lived in the sqlite file as BLOBs. If you don't want to install the package, just download the module source and edit import json
import re
import sys
from mozidbedit import mozidb
idb = mozidb.IndexedDB(sys.argv[1])
for k in [x for x in idb.list_objects() if x.startswith("!extdb.@uid#")]:
uid = re.match(r".+#([0-9a-f-]{36})", k).group(1)
name = idb.read_object("!extdb.@uid#" + uid)["value"]
source = idb.read_object("!extdb.@source#" + uid)["value"]
print(f"{uid}:{name}")
with open(uid + ".js", "w", encoding="utf-8") as f:
f.write(source)
idb.close() |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Sorry if this is the wrong venue, but I'm trying to recover corrupted(?) Firefox Tampermonkey files and I don't know where else to ask.
My PC crashed with a blue screen, and when I re-launched Firefox, Tampermonkey does not work at all. Clicking the TM icon in the toolbar just shows a tiny grey window with an infinite spinner. There's no way to access the dashboard or anything, all I can do is disable or enable the extension. If I try to load any webpage where TM would be allowed to work (basically anything outside of mozilla.org), it takes exactly 40.96s (every time, on the dot) to load the page. Disabling TM fixes that.
In the extension inspection console, I get the following log when I enable TM:
If I navigate to "...(Profile)\storage\default\moz-extension+++e3437203-9ae7-4b24-87ff-e692c539392e^userContextId=4294967295\idb" and delete the "3647222921wleabcEoxlt-eengsairo.sqlite" file (the Tampermonkey local storage file, right?), then TM creates a new blank file and everything works again, but all of my scripts and settings are gone.
So, presumably, a TM script was probably writing something to a file and it got corrupted when I BSODed. Is there any way to retrieve and restore whatever non-corrupted data is still in there? I tried opening the sqlite file with DB Browser but I've never worked with SQLite before so I had no idea what I was looking at.
Environment
All reactions