Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider polyfilling for IE using execCommand #56

Closed
sudodoki opened this issue Dec 19, 2013 · 6 comments
Closed

Consider polyfilling for IE using execCommand #56

sudodoki opened this issue Dec 19, 2013 · 6 comments

Comments

@sudodoki
Copy link

Any thoughts/wishes on implementing some Polyfill for IE9, since its presence is somehow high on the browser share? Or should it be handled by end-users?

@sudodoki
Copy link
Author

My best shim that doesn't involve flash and works fine enough for some purposes is

w = window.open();
doc = w.document;
doc.open( mimetype,'replace');
doc.charset = "utf-8";
doc.write(data);
doc.close();
doc.execCommand("SaveAs", null, filename)

It might be that that's what you called 'proprietary IE API' in #8

@eligrey
Copy link
Owner

eligrey commented Dec 19, 2013

Yeah, that was the API I was thinking about. Personally, I don't think we should polyfill in support for IE due to the limited mime types and confusion that might cause with FileSaver.js users. There's also the extra support I would have to provide. Supporting IE9 would probably require updates to Blob.js as well.

Maybe we could mention this method in the readme. What are your thoughts?

@sudodoki
Copy link
Author

I might tell you that even mentioning the way in this issue might be sufficient 😄
Probably not the best idea to have this in codebase since this code won't be 100% polyfill.
I would, however, consider putting link or short description / hint for googling, since some people are discovering this library via Modernizr's Polyfills page so they might be indeed interested in or even solving only IE compatibility issue.

@sudodoki
Copy link
Author

I've got to be featured in some project's README. Such an honour. 😊 Awesome lib, keep up the good spirit.

@cpbotha
Copy link

cpbotha commented Jan 28, 2014

On IE9 I'm using the doc.execCommand() alternative with mimetype text/plain and a .txt extension in the filename. However, the file that gets saved still has a "doctype html public ..." header, with the data I saved enclosed by "PRE".

Any ideas what I'm doing wrong?

@cpbotha
Copy link

cpbotha commented Jan 28, 2014

With this version it worked perfectly: http://stackoverflow.com/a/4458807

Two major differences that I applied: 1. window.open() parameters and 2. removed document.open()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants