Extension read file from downloads






















Currently an extension cannot choose to download a file into a particular location for file name based on rules from the extension. The downloads API is limited to just the downloads directory.

The problem here is giving a prompt that is understandable to the user. There is quite a difference from the user picking a directory and the extension presenting a directory to the user. Currently this is not something we plan to implement. Some extensions just want somewhere to store data in a profile and have it persist between restarts of Firefox.

Example extensions are photo editors. For this we have an indexedDB store. That can store a large amount of data with user permission, although there are limits. The extension is then able to store, load and manipulate those files efficiently and remain securely inside the WebExtensions and Firefox sandbox.

Drag and drop and file picker support currently exists for providing read access to files and directories. One known limitation is that drag and drop only works on a content element that can receive a file drop event.

It would be nice to enable it across the entire browser. This would require modification of content handlers. It could be responseBlob on the xhr request — Kinlan. Yah, Can you edit the code to show how to do that? I have no idea where to put the location. How can you set it to download as the correct file type?

Chrome keeps trying to download it as an html file. The page that the blob is created on also freezes up and crashes. It also appears that the source of the blob is blank. Can you show some example code of what you are trying to do that makes it crash - it is so hard to tell what you are now trying to do.

I would say that I have added a small piece of code to override the mimetype. Show 1 more comment. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name.

Email Required, but never shown. The Overflow Blog. Who owns this outage? Building intelligent escalation chains for modern SRE. Podcast Who is building clouds for the independent developer? Featured on Meta.

Now live: A fully responsive profile. Reducing the weight of our footer. Yea, true. This really is much more complicated. Thanks for these explanations. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown. The Overflow Blog. Who owns this outage? Building intelligent escalation chains for modern SRE.

Podcast Who is building clouds for the independent developer? Featured on Meta. If this is not done, the memory will not get returned until the page on which it was created is closed. Once the blob URL has been revoked, any attempt to load it will result in an error.

For example, if the blob url was used as the SRC attribute of an IMG tag, the image will not load and will not be visible. Where you have a native app or want to deliver additional native features for file processing, use native messaging to pass a file to a native app for processing. Here you trigger the process with runtime. Port object. Using the onMessage. The native application is opened if it is not running when runtime. Here you use runtime. The browser closes the native application after receiving any message back from the native application.

To add the file or blob you want the native application to process use JSON.



0コメント

  • 1000 / 1000