webpage is not found – ERR_FILE_NOT_FOUND while developing Chrome Extension

This problem was observed on Windows 7 with SP1, in which Internet Explorer 10 and Google Chrome are both installed.

Even if this is not your setup, it is possible you have a similar problem, but no guarantee is made.

While trying out the Google Chrome Extension Getting Started tutorial, I immediately ran into problems with the example app not working.

The error message displayed was the following:

After a bit of troubleshooting, I discovered the problem was that the file popup.html did not exist – which is exactly what the error message is complaining about.

I did have a popup.htm file, though – notice the missing 'l' at the end.

After renaming the file, the problem went away and the sample extension worked. It also worked if I edited the manifest so the file name was popup.htm

Why did this happen?

It turns out that I downloaded the sample files using Internet Explorer 10. For some reason, Internet Explorer 10 renamed the file popup.html to popup.htm which meant the file did not match the manifest, which meant the file in the manifest could not be found, hence the message.

Dissecting the Error Message in More Detail

It is not the friendliest error message, but it is correct – if you understand it.

This webpage is not found

Pretty standard, and somewhat misleading, message – I assumed it meant the “kittens” page was not found.

No webpage was found for the web address: chrome-extension://pchknohkaionalnpgmgdniblddmobdok/popup.html

This line had me stumped. Obviously this is not a valid URL, so it is not surprising the webpage was not found.

I assumed (incorrectly) that in the javascript code, the URL was somehow being badly mangled or incorrectly formed. This is not the case. The components or elements of a chrome extension are accessed as though they are a web resource, but, instead of beginning with http://, the begin with chrome-extension://, followed by the ID of the extension followed by the name of the resource (which, in this case, is the file popup.html).

Error 6 (net::ERR_FILE_NOT_FOUND): The file or directory could not be found.

Once you know what the previous line means, this one simply repeats it in different words.

Leave a Reply

Your email address will not be published. Required fields are marked *