I just tested http://html5demos.com/file-api in webbrowser-app on my desktop (unity7), and dropping an image file onto the target fails to display it, I’m seeing the following error in the console:
The code is this and it's working if I load the uwp/index.html in chromium,
but on phone always return in the errorHandler a SECURITY_ERR error:
window.requestFileSystem = window.requestFileSystem ||
window.webkitRequestFileSystem;
// Create a variable that will store a reference to the FileSystem.
if (window.requestFileSystem) {
initFileSystem();
} else {
alert('Your browser doesn\'t support the FileSystem API');
}
function initFileSystem() {
navigator.webkitPersistentStorage.requestQuota(1024 * 1024 * 5,
function(grantedSize) {
// Request a file system with the new size.
window.requestFileSystem(window.PERSISTENT, grantedSize, function(fs) {
// Set the filesystem variable.
filesystem = fs;
console.log('OK!');
}, errorHandler);
}, errorHandler);
}
function errorHandler(error) {
console.log('>>> '+error.name +': '+ error.message);
}
Not in this case - requestQuota will grant 5MB without requesting permission.
But the filesystem API won't work from file: URLs, as there's no origin. It doesn't work in Chrome from file: URLs either unless you weaken its security by running it with --allow-file-access-from-files
Those won't help here - this can only be enabled by passing a global flag to Chromium.
allowFileAccessFromFileUrls and allowUniversalAccessFromFileUrls are foot-guns - they're really dangerous options and we shouldn't be relying on them in any shipping code. We need to figure out a better way to run local HTML applications that doesn't depend on file URLs and doesn't use the webview (which is a poor fit for your use-case anyway)
> to actually deprecate WebView entirely for local HTML applications
What? :O I think the ~30% of the apps (not webapps) in the Store is
based in a webview container.
If Ubuntu sold HTML5 apps as development option, IMHO they should have
a real HTML5 environment with all options. As example, uWriter could
be a great word processor, but without save files, it's just a weird
app.
The security is not an issue for me, because the apps are isolated.
What specifically in the File API is not working for you? Can this bug be marked a duplicate of bug #1490749 maybe?