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

Added download attribute check for IE11 #22

Merged
merged 3 commits into from
Mar 27, 2018
Merged

Conversation

grneggandsam
Copy link
Contributor

Summary

This fix checks for a download attribute in the onbeforeunload listener so that downloads aren't confused with redirects in IE11

Additional Details

The download attribute on a link tag typically lets the browser know that the link is a download instead of a redirect and therefore skips firing the onbeforeunload listener. However, the download attribute is not supported in IE11. a workaround is to look specifically look for the download attribute and return if it is found.

@@ -260,6 +260,9 @@ class Application extends EventEmitter {
}

unload() {
if (document.activeElement && document.activeElement.hasAttribute('download')) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

put a comment as to why you are doing this

@mhemesath
Copy link
Contributor

Please add a note in release notes

@kafkahw
Copy link
Contributor

kafkahw commented Mar 27, 2018

code change looks good to me. waiting for release notes

@slor
Copy link

slor commented Mar 27, 2018

I confirmed with @mhemesath offline that this code is +1. OK to close review.

@grneggandsam grneggandsam merged commit 211fa30 into master Mar 27, 2018
@grneggandsam grneggandsam deleted the download-link-fix branch April 27, 2018 18:53
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

Successfully merging this pull request may close these issues.

6 participants