html5-filesystem

Accessing file data after download in Chrome…?

纵然是瞬间 提交于 2019-11-29 02:41:52
I'm writing an extension that would ideally read files after they are downloaded (through the normal download process). Is that possible? I can get the filename through chrome.downloads operations, but I can't find ways of reading the actual bytes. I don't need to write or move them, just read. I struggled with the exact same problem and finally found an easy workaround to read the content of downloaded files from a Chrome extension. You just need to add a permission to file://* in your manifest file and once you have your file's path in the system (with chrome.downloads.search in the filename

Pass large amounts of data between web worker and main thread

一曲冷凌霜 提交于 2019-11-28 21:24:30
Is there a way to pass large amounts of data (multiple MB) between a web worker and the main thread? I work in a project where I need to download files, modify them a bit and then somehow let the user download the modified file. I found the following ways to pass data between a web worker and the main UI Using the regular postMessage method. Using transferable objects (Chrome only) Create a URL reference to a blob and only send the URL (works in Chrome, in others as well?) I think (1) is fine when sending smaller objects but it takes a lot of time and space when dealing with files larger than

Why does this filesystem api requestQuota call fail?

你说的曾经没有我的故事 提交于 2019-11-28 11:38:39
I'm writing an HTML5 app to run in Chrome but it will be on the local filesystem (so they'll start it by double-clicking an html file). It is throwing an error when I try to access the filesystem and I think it's because it's a local file. Is there a way to make Chrome allow this? (NOTE: I do get the popup asking me to allow the app to store permanantly and I click "OK". It still throws this error) The below code throws the error: DOMException {message: "NotSupportedError: DOM Exception 9", name: "NotSupportedError", code: 9, INDEX_SIZE_ERR: 1, DOMSTRING_SIZE_ERR: 2…} filetest.html <!DOCTYPE

HTML5 File System - How to read directories using directory reader?

☆樱花仙子☆ 提交于 2019-11-28 11:32:32
I loaded a directory using file input and webkitdirectory as mentioned below. <input id="file_input" type="file" webkitdirectory directory /> After directory selected I can read file size and other information. My question is how to read this directory using DirectoryReader interface. I tried with below code, but not success. results.length becomes zero. Am I missing anything? window.requestFileSystem(TEMPORARY, 1024*1024 /*1MB*/, function(fs) { var dirReader = fs.root.createReader(); var entries = []; // Call the reader.readEntries() until no more results are returned. var readEntries =

How to use navigator instead of window.webkitStorageInfo HTML5 File-system API?

守給你的承諾、 提交于 2019-11-28 06:50:38
So there is a similar post found here html-5-filesystem-access-type-error . However, I'm not very satisfied with the conclusion because I do not feel it actually answered the question - the solution given is the deprecated code solution. Does anyone know how to use navigator instead of window as the Chrome console is informing to do? I have been using the following and it works, but the chrome console keeps informing me not to do so because it is deprecated. Working Deprecated Code window.webkitStorageInfo.requestQuota(PERSISTENT, 1024*1024*280, function(grantedBytes) { window

Chrome Apps : How to save blob content to fileSystem in the background?

前提是你 提交于 2019-11-28 04:16:15
问题 In Chrome Apps, I'm downloading a blob content from a server using JavaScript XHR (Angular $http GET in particular, with response type 'blob') How should I save this to chrome application's file system? Currently using an Angular wrapper on HTML5 filesystem API https://github.com/maciel310/angular-filesystem I do not want to show user a popup (hence I can't use chrome.fileSystem. chooseEntry ) The chrome.fileSystem.requestFileSystem API is only supported by Kiosk-only apps. Hence I'm using

Pass large amounts of data between web worker and main thread

不问归期 提交于 2019-11-27 20:55:56
问题 Is there a way to pass large amounts of data (multiple MB) between a web worker and the main thread? I work in a project where I need to download files, modify them a bit and then somehow let the user download the modified file. I found the following ways to pass data between a web worker and the main UI Using the regular postMessage method. Using transferable objects (Chrome only) Create a URL reference to a blob and only send the URL (works in Chrome, in others as well?) I think (1) is fine

How to use webkitRequestFileSystem at file: protocol

好久不见. 提交于 2019-11-27 15:48:58
According to Exploring the FileSystem APIs at Browser support & storage limitations You may need the --allow-file-access-from-files flag if you're debugging your app from file:// . Not using these flags will result in a SECURITY_ERR or QUOTA_EXCEEDED_ERR FileError. Launched chromium with --allow-file-access-from-files , --unlimited-storage and possibly deprecated --unlimited-quota-for-files ; also --unsafely-treat-insecure-origin-as-secure=file:///path/to/directory/* with --user-data-dir=/path/to/directory set. Interestingly, when chromium opens a notification is displayed You are using an

How to use navigator instead of window.webkitStorageInfo HTML5 File-system API?

折月煮酒 提交于 2019-11-27 01:38:23
问题 So there is a similar post found here html-5-filesystem-access-type-error. However, I'm not very satisfied with the conclusion because I do not feel it actually answered the question - the solution given is the deprecated code solution. Does anyone know how to use navigator instead of window as the Chrome console is informing to do? I have been using the following and it works, but the chrome console keeps informing me not to do so because it is deprecated. Working Deprecated Code window

Browserify with require('fs')

限于喜欢 提交于 2019-11-26 20:46:42
I was trying to use browserify on a file that uses the fs object. When I browserify it, the call to require('fs') doesn't get transformed and require returns {} . Is there any workaround for this? I've seen some suggestions on stackoverlow and elsewhere, but none seem to be fully realized. I actually hoped to create a google web packaged app using browserify for a class I teach. Thanks in advance. Which filesystem should the browser use then? The HTML5 filesystem is not really comparable to a traditional filesystem. It doesn't have symlinks, and it is only accessible asynchronously outside Web