Fixes Execution error in IE11 #4128
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes a weird IE11 edge case, potentially related to IE11 handling of object references that traverse frames.
Motivation and Context
In IE11 we were unable to execute requests after authenticating. After authenticating and attempting to execute a request in IE, the below error was logged to the console and the "Loading" indicator stayed present in the UI. The HTTP request also never executed. I believe the error number indicates a NullPointerException in IE, but not sure.

I tracked the exception source down in swagger-js to:
At this point
tokenwas defined buttoken.access_tokenaccess threw an error. The debugger value was hidden (not able to view the properties of the object) and loggingtokendisplayed 'Permission Denied'.This only occurred in IE, while chrome and others worked just fine. I'm still unsure the exact cause, but my hunch is that because the
tokenobject is originally generated in the oauth2 frame, there is some weird permission interaction with the parent frame. So, I attempted to break the reference and it seems to resolve the issue. This change would probably work in other places, specifically within the auth callbacks themselves, so we can move it if needed.How Has This Been Tested?
Fixes the issue and IE and I see no regression in Chrome.
All existing tests pass in my fork:

Types of changes
package.json)Checklist: