I have a Chrome packaged app that requires me to be able to view saved, offlined web pages. These pages are downloaded from my server when the user is online and saved to the HTML5 filesystem so that they can be viewed offline. This Chrome bug ticket seems to indicate that what I want to do is possible: https://code.google.com/p/chromium/issues/detail?id=343382
Based on the Chrome app 'webview' docs (https://developer.chrome.com/apps/tags/webview), this is what I came up with.
In my manifest:
"permissions": [
{
"fileSystem": ["write"]
},
"storage",
"unlimitedStorage",
"webview"
],
"webview": {
"partitions": [
{
"name":"contentView",
"accessible_resources":["*.html"]
}
]
}
My webview tag:
<webview id="websiteWebview" minwidth="800" minheight="600" autosize="on" partition="contentView"></webview>
And then I'm adding the 'src' attribute through javascript:
var websiteWebview = document.querySelector('#websiteWebview');
websiteWebview.setAttribute('src', decodeURIComponent(srcUrl));
This results in the following in the console:
filesystem:chrome-extension://[appId]/[pathToFile]/index.html
Failed to load resource: net::ERR_FILE_NOT_FOUND
Not allowed to load local resource: filesystem:chrome-extension://[appId]/[pathToFile]/index.html
I'm not sure where to go from here. Thanks in advance for your help!