Repository navigation
Perform XHR in the main context - #7818
Merged
Merged
Conversation
mourner
reviewed
Jan 25, 2019
kkaefer
force-pushed
the
ie-referrers
branch
2 times, most recently
from
January 25, 2019 15:27
23a17ff to
68d2171
Compare
asheemmamoowala
approved these changes
Jan 29, 2019
asheemmamoowala
left a comment
Contributor
There was a problem hiding this comment.
Pending resolution of comment
…referrer information IE11 doesn't send the correct referrer for XHRs in a web worker. Instead, we're now doing the request from the main context and transfering the result back to the worker. Most modern browsers will continue to use the Fetch API and will not be affected by this change.
Member
Author
|
Also fixes #7603 |
mourner
approved these changes
Jan 30, 2019
This was referenced Jan 30, 2019
gpiffault
reviewed
Jan 31, 2019
| // that we can get an accruate referrer header. | ||
| // - Requests for resources with the file:// URI scheme don't work with the Fetch API either. In | ||
| // this case we unconditionally use XHR on the current thread since referrers don't matter. | ||
| if (!/^file:/.test(requestParameters.url)) { |
There was a problem hiding this comment.
I can confirm this, you have to specify the absolute path with the file protocol before passing it in, else it thinks it is an http request and throws an error about the file protocol like before.
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
...rather than the worker's to preserve referrer information.
IE11 doesn't send the correct referrer for XHRs in a web worker. Instead, we're now doing the request from the main context and transfering the result back to the worker. Most modern browsers will continue to use the Fetch API introduced in #7371 and will not be affected by this change.
Launch Checklist
document any changes to public APIsI looked at the impact of transferring the ArrayBuffer/Image object in IE and it's very small, typically below 1ms. In any case, this code path will only be triggered in IE11 (and other older browsers that don't support the Fetch API).
I added a
Cancelablemode to the Actor as well so that we can cancel requests across workers.