Limitations
Mozquery has some limitations you should be aware of when using the Code panel editor. These limitations are those of the underlaying Mozilla Midas editor.
Line length
Midas automatically introduces a line break (actually a break tag: <br />) when a line is longer than 128 characters.
Any line break is converted to new line (\n) before evaluating the code to run. So, if the new line character is occuring in the middle of a string, it will raise an unterminated string error.
The workaround is to take care to limit the length of your code lines to a value less than 128 characters (a good habit anyway as the code is easier to read), or to manually introduce the line break in the middle of the string and put a forward slash character (\) at the end of the line (the usual way to indicate a line break within a string in JavaScript).
Skipping Midas
The Code panel has very basic editing features, far from those provided by any descent text editor used to develop code.
If you want to take advantage of a powerful text editor (
jEdit for instance), you can write your scripts in this editor, save the file when you want to run the code, then switch to Mozquery window and load the file in the Code panel where you can run it.
If you need to modify the code, go back to your editor, make the changes then, switching again to Mozquery window, use the reload command to immediatly get the modified code in your Code panel and run it.
This way you can have a powerful editor to write the code and a powerful console to run it.
Report limitations
If you discover limitations not mentioned here, please report them sending a mail to Mozquery mailing-list.
Use the context menu to navigate in the documentation pages