Skip to content
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

Disable MessagePort workaround under Safari >= 16 #6602

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

robertknight
Copy link
Member

The bug described in https://bugs.webkit.org/show_bug.cgi?id=231167 was fixed in Safari 16. The workaround for Safari <= 15 is triggering an error in VitalSource LMS assignments [1]. Fix the issue for Safari >= 16 by disabling the workaround in browsers where it is not required.

[1] https://github.com/hypothesis/support/issues/161#issuecomment-2407558020

The bug described in https://bugs.webkit.org/show_bug.cgi?id=231167 was fixed in
Safari 16. The workaround for Safari <= 15 is triggering an error in VitalSource
LMS assignments [1]. Fix the issue for Safari >= 16 by disabling the workaround
in browsers where it is not required.

[1] hypothesis/support#161 (comment)
Copy link

codecov bot commented Oct 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.42%. Comparing base (d9b9d94) to head (eefbc8c).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6602   +/-   ##
=======================================
  Coverage   99.42%   99.42%           
=======================================
  Files         270      270           
  Lines       10169    10175    +6     
  Branches     2417     2419    +2     
=======================================
+ Hits        10111    10117    +6     
  Misses         58       58           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// If no version info, we guess that the browser is a new version of
// WebKit which is not affected.
return false;
}
Copy link
Member Author

@robertknight robertknight Oct 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There a possibility for a false positive here if this is a non-Safari WebKit-based browser that is equivalent to Safari 16 or newer but has a Version/ token that is < 16.

A possible workaround might be to check for a new browser API that was added in Safari 16 instead, like HTMLFormElement.prototype.requestSubmit. This code runs in the context of a third-party web page, so there is a risk that such an API gets polyfilled.

In any case, the set of browsers for which the workaround is enabled in this PR is strictly a subset of those where it was previously used.

@robertknight robertknight merged commit 7fdab18 into main Oct 14, 2024
4 checks passed
@robertknight robertknight deleted the disable-safari-pre-16-workaround branch October 14, 2024 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants