I am writing a fairly simple extension for Chrome. The main graphical body of it (the part dealing with html, i.e. the front-end) works fine, but when I try to include a second JavaScript file that uses Jquery’s $.ajax() function to return some info from another page to the front-end, Chrome throws the following error and won’t let me load the extension:
Could not load extension from “Path\to\extension”. Could not load file “filename.js” for content script. It isn’t UTF-8 encoded.
I don’t honestly know enough about UTF-8 encoding to be able to tell what would make Chrome say that about my file. I have no special characters, no accent marks or anything, which i know can screw things up. I haven’t been able to find a good solution anywhere, either.
An easy way to UTF-8 encode your files, is to use an editor that allows you to choose that encoding. If you can’t do that, there are (fairly standard) tools on linux/unix system to check (file) and to change (iconv, recode) the encoding. If you use Windows, such tools can be installed.