Skip to content

Commit

Permalink
🐛 Fix: Accessing window.top.{constructor|prototype} throws error in iOS
Browse files Browse the repository at this point in the history
Exclude window.top so that no security errors are thrown when es5-shim is used in an iframe from a
different domain
  • Loading branch information
Tom Gasson committed Jun 27, 2017
1 parent 7f6ddd6 commit d25c446
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion es5-shim.js
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,8 @@
$webkitStorageInfo: true,
$external: true,
$width: true,
$height: true
$height: true,
$top: true
};
var hasAutomationEqualityBug = (function () {
/* globals window */
Expand Down
2 changes: 1 addition & 1 deletion tests/spec/s-object.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ describe('Object', function () {

ifWindowIt('can serialize all objects on the `window`', function () {
var windowItemKeys, exception;
var excludedKeys = ['window', 'console', 'parent', 'self', 'frame', 'frames', 'frameElement', 'external', 'height', 'width'];
var excludedKeys = ['window', 'console', 'parent', 'self', 'frame', 'frames', 'frameElement', 'external', 'height', 'width', 'top'];
if (supportsDescriptors) {
Object.defineProperty(window, 'thrower', {
configurable: true,
Expand Down

0 comments on commit d25c446

Please sign in to comment.