2

I am writing a chrome extension that dynamically writes some html pages and their resources to the file system. I have most things working but I just noticed that when I try to open one of the pages by navigating to the filesystem:chrome-extension://... url that I obtain via the fileentry.getURL() method, the page opens, but chrome does not fetch any of the associated resources: stylesheets, images etc. Any ideas why this might be? Are there some security flags I need to get this working? I am i going about this all wrong?

(One thing that may be relevant is that the resources are identified by relative urls. But I know they are correct relative to the file because if i manually resolve them and browse to the URLs I can fetch them.)

1 Answer 1

2

The page you include that uses the relative URLs doesn't understand the HTML5 filesystem's mapping. If you change the URLs to point to what the fileentry.getURL() calls give you, then this should work.

There's currently a bug that allows relative URLs in resources to be used like you're trying to do: http://crbug.com/89271

Sign up to request clarification or add additional context in comments.

2 Comments

Yep, you are right those bugs are talking about exactly what I am talking about, seems like chrome isn't adding on the filesystem: prefix when resolving the relative URLs. That said, I really don't know how to solve the problem myself. Seems impossible to resolve all the URLs manually...
well, you could catch the resources as you write them and include the absolute URLs. It kind of depends on how you're generating the html pages.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.