I accidentally deleted two Firefox files (recovery.js and recovery.bak) that contained the details of a huge number of tabs that I have open when I use Firefox.
The tabs (website information) are everso important to me.
I understand that recovery.js is javascript.
I have recovered the contents of recovery.js by grepping the hard drive, but there are 5 syntax errors in it, so Firefox doesn't recognise it or use it. The recovery.js is 2.1 MB in size and is one long record, with no newlines.
The following rhino-jsc command gives some sparse information about the syntax errors. I know nothing about rhino-jsc, other than that it will show syntax errors. :
$ rhino-jsc RECOVERED-recovery.js
<the javascript was printed here>
Exception in thread "main" org.mozilla.javascript.EvaluatorException:
Compilation produced 5 syntax errors. (RECOVERED-recovery.js#1)
at
org.mozilla.javascript.tools.ToolErrorReporter.runtimeError(ToolErrorReporter.
java:111)
at org.mozilla.javascript.Parser.parse(Parser.java:569)
at org.mozilla.javascript.Parser.parse(Parser.java:478)
at
org.mozilla.javascript.optimizer.ClassCompiler.compileToClassFiles(ClassCompiler
.java:134)
at org.mozilla.javascript.tools.jsc.Main.processSource(Main.java:242)
at org.mozilla.javascript.tools.jsc.Main.main(Main.java:39)
Unfortunately, I don't know anything about javascript, and don't know what the above error messages are telling me.
My Questions:
Could you tell me how to find out WHERE in the file, those 5 syntax errors are, and preferably EXACTLY WHICH character(s) they are?
Is there a better syntax checker that will enable me to locate precisely WHERE the errors are, and WHAT they are? I'd rather not use an ONLINE syntax checker because of privacy concerns.
If I can't work out, what to change, in order to correct the syntax errors, is there a typical block* of script that I can safely delete that contains each error, even if it means losing the tabs that the deletion results in? (*A very small section hopefully).
What editor can I use to edit the huge .js file? I have the Bluefish editor on my system but it exhibits faulty behaviour. I've tried opening the file in Kate but it doesn't load. The problem with a hex editor is that the text is inconveniently displayed in a small 16-character-wide column.
If I can correct the syntax errors, or delete the block(s) they're in, hopefully Firefox will then recognise this recovery.js.