Skip to content

Commit 211fa30

Browse files
authored
Added download attribute check for IE11 (#22)
* Added download attribute check for IE11 * Added comment for clarity * Added release note to changelog
1 parent a74c23f commit 211fa30

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Next Release
22
-------------
3+
* Added download attribute check for IE11 in unload trigger.
4+
35
1.5.0
46
------
57
* Added support for calculating height of body containing absolute positioned elements.

src/provider/application.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,10 @@ class Application extends EventEmitter {
260260
}
261261

262262
unload() {
263+
// Need this line because IE11 & some safari trigger onbeforeunload despite presence of download attribute
264+
if (document.activeElement && document.activeElement.hasAttribute('download')) {
265+
return;
266+
}
263267
this.JSONRPC.notification('unload');
264268
this.trigger('xfc.unload');
265269
}

0 commit comments

Comments
 (0)