script-lab-2017 icon indicating copy to clipboard operation
script-lab-2017 copied to clipboard

Cannot "Export for publishing" on macOS

Open hongbo-miao opened this issue 8 years ago • 11 comments

Current Behavior

When I click "Export for publishing", image

it shows this image

Your Environment

  • Operating System and version: macOS 10.12.5

hongbo-miao avatar Jun 26 '17 17:06 hongbo-miao

If you were to do the same thing from the browser (https://script-lab.azureedge.net), does the issue occur there as well? Or is it only because it's an add-in.

We use FileSaver.js for exporting. Could you also see if these demos work for you: https://eligrey.com/demos/FileSaver.js/?

Thanks!

Zlatkovsky avatar Jun 26 '17 19:06 Zlatkovsky

@Hongbo-Miao , please take a look at the questions above. thanks!

Zlatkovsky avatar Jun 26 '17 19:06 Zlatkovsky

Just tried, both https://script-lab.azureedge.net and https://eligrey.com/demos/FileSaver.js succeed download the file.

Tested on Safari 10.1.1 too.

hongbo-miao avatar Jun 26 '17 20:06 hongbo-miao

In that case, it might be a platform bug with agaves on Mac. Could you please file a bug and follow up with Dan or Julian? Thanks!

Zlatkovsky avatar Jun 26 '17 22:06 Zlatkovsky

@dsaunders45459 saw u self-assigned, let me know if still need notify Dan.

BTW, may be related with https://github.com/eligrey/FileSaver.js/issues/129

hongbo-miao avatar Jun 28 '17 21:06 hongbo-miao

I thought this was an issue with Mac platform so I assigned to myself, but it seems to also repro on Safari. @Hongbo-Miao you can fix if you want if not a platform issue.

codexeon avatar Jun 29 '17 22:06 codexeon

@dsaunders45459 actually I am not sure what cause this since it works on my Safari. Please keep diging into it.

hongbo-miao avatar Jun 29 '17 23:06 hongbo-miao

I spent more time investigating this. Safari had the same bug before 10.1, the FileSaver library would not work for it. Mac Office uses the WebKit control to embed Script Lab, and it looks like it is not currently possible for the blob download approach FileSaver uses to work with this control using public WebKit API. An alternate approach could be to use window.open on a data-uri and base64 string for the contents, but FileSaver library does not do this. I have opened a bug in WebKit https://bugs.webkit.org/show_bug.cgi?id=174076 to enable blob downloads, but the fix will not be available in the foreseeable future. For now I think we should hide the button on the Mac platform, I will send out a pull request.

codexeon avatar Jul 02 '17 19:07 codexeon

@dsaunders45459 , another customer just ran into this same issue. Is there anything we can do at the platform side to make this work, after all? https://stackoverflow.com/questions/44922159/office-add-in-javascript-filedownload-not-working-with-mac/44932466?noredirect=1#comment76856056_44932466

Zlatkovsky avatar Jul 06 '17 15:07 Zlatkovsky

@Zlatkovsky last I remember it wasn't a platform specific issue but the way Safari works itself esp with the 9.1/9.2 version. @Reezaali could you assist with this given that you had built a Add-in for the same earlier using multiple techniques.

WrathOfZombies avatar Jul 07 '17 22:07 WrathOfZombies

Here's the code sample that @WrathOfZombies was asking for: https://github.com/OfficeDev/Office-Add-in-JavaScript-FileDownload/blob/master/FileDownloadSampleWeb/Home.js

Reezaali avatar Jul 15 '17 03:07 Reezaali