aurelia / metadata

Utilities for reading and writing the metadata of JavaScript functions.
MIT License
28 stars 33 forks source link

IE11 cross origin frame 'Access Denied' error in Origin.get #53

Closed valery-vitko closed 6 years ago

valery-vitko commented 6 years ago

IE11 in cross origin frame fails when accessing Window['frameElement'] with 'Access Denied' script error.

Here is the fork of skeleton-navigation with a test page added reproducing the issue 'in the field' - https://github.com/Steinpilz/skeleton-navigation/tree/ie-xorigin-frame-access-denied, project 'skeleton-typescript-webpack'. Run and open http://127.0.0.1:8080/frame.html in IE11, try to navigate to the Test Page. It will fail because of Origin.get Aurelia requests while processing the view dynamically composed via <compose view-model="...". Since we have Window exported as a module by webpack via buildin/global.js, Origin.get enumerates its members and fails on frameElement.

Not quite sure if it's the proper fix though, but it seems the least disruptive one for me. The tests I've added is synthetic and expects Origin.get to handle any error, not only from Window['frameElement'].