Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Selector: Only attach the unload handler in IE & Edge Legacy
Both IE & Edge Legacy need the workaround of calling `setDocument()` in an `unload` handler to avoid "permission denied" errors. However, due to not being possible to feature-detect this issue, the handler has been applied in all browsers for windows different than the one in which jQuery was loaded. jQuery 4.0, which drops Edge Legacy support, guards this workaround with a `document.documentMode` check. This won't work in the 3.x line due to still supporting Edge Legacy but we can check for `document.documentElement.msMatchesSelector` instead as that API is supported in IE 9+ and all Edge Legacy versions. Fixes gh-5281 Closes gh-5282 Ref gh-4792
- Loading branch information