GM overwrite my existing script. Is it possible to recover it?

180 views
Skip to first unread message

Dmitry Zorin

unread,
Nov 25, 2012, 1:55:02 PM11/25/12
to greasemon...@googlegroups.com
When I created new user script, GM don't asks me for new script. Instead of that GM overwrite one of my existing scripts and erase all code. So I lost all my source code changes for two work days.

Is there any chance to recover it from open tab with this active script in Firefox from memory?

Thanks.

P.S. Sorry for my english.

Anthony Lieuallen

unread,
Nov 25, 2012, 7:40:43 PM11/25/12
to greasemon...@googlegroups.com
On Sun, Nov 25, 2012 at 1:55 PM, Dmitry Zorin <diov...@gmail.com> wrote:
Is there any chance to recover it from open tab with this active script in Firefox from memory?

No.

But how did you "create new user script"?  The built in feature should ask before it overwrites an existing script.  (If you just created a file then installed it, then that's just how it works.)

Dmitry Zorin

unread,
Nov 27, 2012, 8:14:16 AM11/27/12
to greasemon...@googlegroups.com
1) My first script was opened in Notepad++ application
2) Later I decide to create a second script. I go to GM menu in Firefox, and clicked that function.
3) Firefox window immediately lost focus. And Notepad++ editor get it, with question that one of my opened files (first script) was changed outside the editor.
4) I clicked to not reload updated file for first script, switched back to Firefox. But did not saw any GM dialog window with newly created script options.
5) After that I repeat all this steps from step 2. Everytime Notepad++ asks me that file was changed outside. And everytime I answered to not reload updated content.
6) I did not immediately realize what is going on. So I thought that GM simply reloads my file in some way. And I close my first script in Notepad++.
7) After that, I tried to create new second script at last. Again I clicked this function in GM menu. But now, Notepad++ opened my first script file and I see cleaned file (!) without any my source code. And what was strange--only top commented section of GM script options was here. Any JS code below was absent.

After all, I wanted to restore my lost work through open tabs in the browser where my first script executes. So I think maybe I find it with help of FireBug extension script panel. Or something. And I asks this question here about that. And here I am.

Also I test my computer hardware now, but all fine. And I don't think that there is a virus that interferes with normal work only when creating scripts for GM in this way. And why he left me a mocking comments section in the script, and wiped all my source code only.
Message has been deleted

Dmitry Zorin

unread,
Nov 27, 2012, 8:46:00 AM11/27/12
to greasemon...@googlegroups.com

I create new user script trought Firefox menu:
"Tools" >> "Greasemonkey" >> "Create script..."
(But I use RU locale and don't know original menu captions.)

And please help me with advice, where can I find a check for "overwrites an existing script" in your "installScriptFromSource" function of GM source code? I think my file was overwritten in here:
Image Link

Безымянный1.png

Anthony Lieuallen

unread,
Nov 27, 2012, 11:10:17 AM11/27/12
to greasemon...@googlegroups.com
On Tue, Nov 27, 2012 at 8:37 AM, Dmitry Zorin <diov...@gmail.com> wrote:
And please help me with advice, where can I find a check for "overwrites an existing script" in your "installScriptFromSource" function of GM source code? I think my file was overwritten in here:

Ah, yes.  I forgot about that feature, it was added recently.  If you have a valid user script metadata block in your clipboard, it just installs it.  It shouldn't overwrite an existing script at that point.

https://github.com/greasemonkey/greasemonkey/issues/1672
Reply all
Reply to author
Forward
0 new messages