Home Link : Last Books Library We read Screenshots Hack |
|||||
|
|||||
Chrome extension download javascriptI am creating an extension that will download a mp3 file off a website. I am trying to do this by creating a new tab with the link to the mp3 file, but chrome keeps opening chrome extension download javascript inside the player instead of downloading it. Is there any way I can create a pop-up to ask the user to "save-as" the file? Stack Overflow is a community of 7. Join them; it only takes a minute: Making a Chrome Extension download a file Ask Question. Franz Payer 1, 12 34 After declaring "downloads" permission in the manifest, one can initiate a chrome extension download javascript with this call: Is it possible to have Chrome append a file to an existing file? I want to do download a file made of fragments, resulting in chrome extension download javascript complete file instead of multiple fragtments. The basic approach is to build your Blob, however you want Chrome has a responseBlob on XmlHttpRequest so you can use thatcreate an iframe hidden, display: This will initiate a download and save it to the filesystem. The only problem is, you can't set the filename yet. An example of using XmlHttpRequest's responseBlob see: Chrome extension download javascript posting your answer, you agree to the privacy policy and terms of service. Stack Overflow Questions Developer Jobs Documentation beta Tags Users. Sign up or log in to customize your list. Tour Start here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us. Log In Sign Up. Join the Stack Overflow Community. The download will still happen and you will be able to see it in the download tab, but they won't see the actual download happen. The way you make an action occur on the content page rather than your extension is to use Chrome "message passing". Basically, you pass a message from your extension which is almost like a separate page to the content page that the extension is working with. You then have a listener that your extension has injected into the content page that reacts to the message and does the download. That is a good point Where do I specify the file I am trying to download? That is up to you. Yah, Can you edit the code to show how to do that? But it's a different question; if you still need help, ask a new question. Xan i got this error: Invalid filename any idea? Edit afterthought about making your code execute on the content page: Steve Mc 2, 15 Chrome extension download javascript is a slightly modified version of Steve Mc's chrome extension download javascript that just makes it into a generalized function that can easily be copied and used as is: AmanicA 3, 24 SteveMC's answer no longer works, but this one does. Fast-forward 3 years, and now Google Chrome offers chrome. After declaring "downloads" permission in the manifest, one can initiate a download with this call:. For chrome extension download javascript options i. Save As dialog, overwriting existing files, etc. I used a variation on the solution here. One thing you need to bare in mind is that this code needs to execute on the page and not your extension - otherwise the user won't see the download action that chrome does. This is a slightly modified version of Steve Mc's answer that just makes it into a generalized function that can easily be copied and used as is:. I did it as follows in Appmator code on Github. I have no idea where to put the location. Sign up or log in StackExchange. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Stack Overflow works best with JavaScript enabled. |
|||||
© Copyright city car driving 13 download utorrent |