I think there's no way to get rid of ^M but hopefully with `*.bat -text` in `.gitattributes` it shouldn't be a problem because git won't do any line conversion on check-in/out.
This way the raw link as well as the file within the zip download should be in proper MSDOS CRLF format, and git status shouldn't report the file as modified either. ***fingerscrossed!!***
- Search string made case-sensitive, because Firefox preferences are.
- The script now uses regex, which allows it to understand user.js files formatted using single quotes, spaces, or tabs.
Trade-off: it can no longer reset preferences that include some special characters in their names. Not an issue for now, just something to remember.