Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit87467a6

Browse files
authored
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 beingpossible to feature-detect this issue, the handler has been applied in allbrowsers for windows different than the one in which jQuery was loaded.jQuery 4.0, which drops Edge Legacy support, guards this workaround witha `document.documentMode` check. This won't work in the 3.x line due to stillsupporting Edge Legacy but we can check for`document.documentElement.msMatchesSelector` instead as that API issupported in IE 9+ and all Edge Legacy versions.Fixesgh-5281Closesgh-5282Refgh-4792
1 parent3c18c1f commit87467a6

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

‎src/selector.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -523,12 +523,17 @@ function setDocument( node ) {
523523
documentElement.msMatchesSelector;
524524

525525
// Support: IE 9 - 11+, Edge 12 - 18+
526-
// Accessing iframe documents after unload throws "permission denied" errors (see trac-13936)
527-
// Support: IE 11+, Edge 17 - 18+
528-
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
529-
// two documents; shallow comparisons work.
530-
// eslint-disable-next-line eqeqeq
531-
if(preferredDoc!=document&&
526+
// Accessing iframe documents after unload throws "permission denied" errors
527+
// (see trac-13936).
528+
// Limit the fix to IE & Edge Legacy; despite Edge 15+ implementing `matches`,
529+
// all IE 9+ and Edge Legacy versions implement `msMatchesSelector` as well.
530+
if(documentElement.msMatchesSelector&&
531+
532+
// Support: IE 11+, Edge 17 - 18+
533+
// IE/Edge sometimes throw a "Permission denied" error when strict-comparing
534+
// two documents; shallow comparisons work.
535+
// eslint-disable-next-line eqeqeq
536+
preferredDoc!=document&&
532537
(subWindow=document.defaultView)&&subWindow.top!==subWindow){
533538

534539
// Support: IE 9 - 11+, Edge 12 - 18+

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp