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.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add option to enable cross-origin isolation #234
base: main
Are you sure you want to change the base?
feat: add option to enable cross-origin isolation #234
Changes from 1 commit
e01f5d9
87e319f
3cd4426
0aee155
0b7e643
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a chance this change could be breaking in the case where someone is explicitly measuring something where external resources are requested?
In this case, may it be worth putting this change behind a
ServerOpts
option, where the default is the current behavior (not cross origin isolated), but the headers can be opted in?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! I totally didn't think of that. 😅
I think making this disabled by default sort of defeats the purpose of improving the timing accuracy, but I also admit I don't have any evidence that CORP/COEP actually does this (maybe the browser treats
localhost
differently? not sure). That said, having the option at least unblocksSharedArrayBuffer
and friends.So sure thing: I added a CLI option,
--cross-origin-isolated
, which is disabled by default. I think further experimentation would be needed to see if it has any effect on timing accuracy. 🙂There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the benefits of having it (even if behind a flag):
SharedArrayBuffer
(and friends) features. They would just have to check thecrossOriginIsolated
property.I'm a fan of this change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding tests!