9

Recently my chrome glitched and tampermonkey just stopped working. I uninstalled and then reinstalled extension (with hope that scripts stay in place), but my scripts got deleted. Luckily I have a backup of profile directory. So how I can restore them?

Artem P
  • 308
  • 2
  • 10

2 Answers2

12

Not clean backup but something. Go to:

%LocalAppData%\Google\Chrome\User Data\Default\Local Extension Settings\dhdgffkkebhmkfjojejmpbldmpobfkfo\

And find file 000003.log or similar. This file stores whole history of changes of all userscripts. Just search for website name, that uses your script.

Artem P
  • 308
  • 2
  • 10
  • 1
    I have a very similar issue. However, `000003.log` appears to be a binary file. How can its script history data be read in plain text? – MJH Nov 27 '16 at 04:38
  • 2
    @MJH I just used Windows build-in Notepad. – Artem P Nov 27 '16 at 06:39
  • Strange. When opened in Sublime Text 3 it appears to be binary data, but when opened in Notepad it appears to be text (rather difficult to read, though). Thanks. – MJH Nov 27 '16 at 06:50
  • This didn't work, the file is empty after the new installation :( – Jay Feb 02 '19 at 16:04
  • Agreed, this will also not open on my machine. But it does seem to be the correct file. I will work harder :D – Jamie Hutber May 26 '19 at 21:51
  • 1
    Life saver! Side-notes: - On a mac, this lives in `~/Library/Application\ Support/Google/Chrome/Default/Local\ Extension\ Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo/000003.log` - Using Sublime Text, go ahead and use File>Reopen with Encoding and select UTF-8. Sublime defaults to a binary file when it sees those 0x00 NULL characters. – aaiezza Jul 09 '19 at 17:17
  • Backup the whole folder, not just the file. On my old Chrome the file name was 000026.log and on the new Chrome, the file name was 000003.log. Just pasting the file doesn't work. Renaming to 000003.log doesn't work either. Copy pasting the whole folder did move all the user scripts from old Chrome to new Chrome. – KulaGGin May 08 '23 at 15:42
2

You can use this python script to extract your scripts from the profile backup folder:

https://gist.github.com/derjanb/9f6c10168e63c3dc3cf0

derjanb
  • 137
  • 2
  • 1
    Please read the question again carefully. Your answer does **not** answer the original question. OP is using Windows not Linux or OS X – DavidPostill Nov 28 '16 at 12:57
  • 2
    @DavidPostill And what is the problem with [installing Python for Windows](http://superuser.com/questions/655348/how-do-i-run-a-python-program-in-windows)? Another option is to boot a Linux Live CD. – derjanb Nov 29 '16 at 19:52
  • @derjanb, the problem is that your software shouldn't be causing problems requiring manual intervention like this to begin with and if you are just providing a solution for yourself then accept when it is not useful. – GµårÐïåñ Nov 27 '22 at 04:23
  • @GµårÐïåñ the problem is not caused by Tampermonkey which only is an extension that uses the a browser API to store data. A slightly modified solution can be used to read and recover every extension's storage. – derjanb Nov 29 '22 at 23:58
  • @derjanb Yes it is in this case, it is an extension but not just an extension, it hold a lot of data such as the scripts and when like today it comes up saying "Extension corrupted" click to "repair" and it wipes everything out, then yes it is a problem. Of course it can ready any, but we are talking specifically for this extension and not everyone is on Linux and this exact script you posted actually does not work on the latest that I tried because I just lost over 80 scripts, luckily I only lost the latest revision as I have backups but still work lost regardless. Thanks. – GµårÐïåñ Dec 01 '22 at 06:15
  • @derjanb he is right. I had to reinstall Windows recently and I forgot to export my tabs from Tab Session Manager. But I had full C backup. You know what? I couldn't recover my tabs even having full backup. Tab Session Manager has option to backup sessions on startup to Download folder, but I thought sessions just plain saved to disk with some json format in browser profile folder. Turned out it's not. Even copy/paste all extension files not working. – Artem P Dec 17 '22 at 01:38