I am very unhappy with this solution because it is not cross-platform, but at least it works. I can confirm that I just did this in Chrome 66 on Mac and it now shows the save as dialog as desired. Then do the following: const url = URL.createObjectURL(blob) Ĭ(args, callback) This will enable the "chrome.downloads" api. First, add the "downloads" permission to the app in its manifest. So let's say you have a blob object to start. Turns out they added a new API and did not mention it some time ago called chrome.downloads. So, to get around it, use the chrome-platform-only APIs available to chrome apps and extensions. Apparently the blob: protocol at start of url makes it cross-origin or something. Software Utility to Update S3G UniChromeII Graphics Automatically: Recommendation: Windows users who are inexperienced in updating Shuttle Computer Graphics Card device drivers can use the DriverDoc driver update tool Download DriverDoc - Product by Solvusoft to help update these S3G UniChromeII Graphics drivers. This only happens if clicked URL is cross-origin. ![]() This causes anchor click to do a redirect instead of a download. ![]() Ran into the same problem, here is how I solved it and my notes.Ĭhrome 65 made a change where anchor download attribute is ignored. I know that Google Chrome apps are going away "soon" but in the meantime, until I can find someone to rewrite the entire application, I really need a solution for all of my users (short of telling them to not upgrade Chrome.).ĭoes anyone know of a different way to automatically download a blob file that won't run into these problems on Chrome Apps? It doesn't need to be cross-browser because it's a Chrome App. It's only a problem in Google Chrome apps, and only since I upgraded to Chrome 65. Note that this code will work fine in the Chrome browser - it automatically downloads the blob file. I've tried this sample code within my app and it shows the same behavior: an error message without target="_blank" and a dialog with target="_blank". Here is a simple jsfiddle from another question (not mine) which has similar code:īlob = new Blob(, , Or choose an existing application on your computer.Ĭlicking "Cancel" on the dialog makes it go away but of course the file isn't downloaded. Search the App Store for an application that can open this document, So I tried adding target="_blank" and now when I click on the menu item I get a dialog: There is no application set to open the URL blob:chrome-extension://lcgc.6b11. ![]() Now, when the user clicks on the menu item, I get the following console error: Can't open same-window link to "blob:chrome-extension://lcgcc.1904" try target="_blank" I've been successfully using with no problems up until Chrome 65. I've got a Google Chrome App (Windows & Mac) written in JavaScript with a menu item to automatically download a log file.
0 Comments
Leave a Reply. |