Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 060ad9b

Browse files
author
Colin Guthrie
committed
Effects: Use a try/catch block to prevent security veto. Fixed #8288 - focus fix causes Firefox Security Manager veto.
1 parent 3577955 commit 060ad9b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

ui/jquery.effects.core.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,12 @@ $.extend( $.effects, {
431431
element.wrap( wrapper );
432432

433433
// Fixes #7595 - Elements lose focus when wrapped.
434-
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
435-
$( active ).focus();
436-
}
434+
// try/catch fixes #8288
435+
try {
436+
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
437+
$( active ).focus();
438+
}
439+
} catch ( e ) {}
437440

438441
wrapper = element.parent(); //Hotfix for jQuery 1.4 since some change in wrap() seems to actually lose the reference to the wrapped element
439442

@@ -472,9 +475,12 @@ $.extend( $.effects, {
472475
element.parent().replaceWith( element );
473476

474477
// Fixes #7595 - Elements lose focus when wrapped.
475-
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
476-
$( active ).focus();
477-
}
478+
// try/catch fixes #8288
479+
try {
480+
if ( element[ 0 ] === active || $.contains( element[ 0 ], active ) ) {
481+
$( active ).focus();
482+
}
483+
} catch ( e ) {}
478484
}
479485

480486

0 commit comments

Comments
 (0)