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

Fix browser support check failure if boot script loaded before body #2691

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

robertknight
Copy link
Member

@robertknight robertknight commented Oct 30, 2020

Fix a sporadic (?) false negative in the test for whether the current browser is
supported if the Hypothesis boot script is included in the <head> of
the page (before the <body>). In this case document.body is null. This can happen in Via when viewing an HTML page (not a PDF).

Given the problem I'd expect it to be consistently reproducible in all browsers, however that appeared not to be the case in practice. See Slack thread.

In any case, I was able to reproduce a failure when visiting https://via.hypothes.is/https://embed.la.utexas.edu/txlatin/2019/03/05/a-trip-to-the-underworld/ in Firefox 82 and Safari 14.

Fix a false negative in the test for whether the current browser is
supported if the Hypothesis boot script is included in the `<head>` of
the page (before the `<body>`). In this case `document.body` is `null`.
@codecov
Copy link

codecov bot commented Oct 30, 2020

Codecov Report

Merging #2691 into master will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2691   +/-   ##
=======================================
  Coverage   97.72%   97.72%           
=======================================
  Files         200      200           
  Lines        7486     7486           
  Branches     1643     1643           
=======================================
  Hits         7316     7316           
  Misses        170      170           
Impacted Files Coverage Δ
src/boot/browser-check.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9906ff6...a09e047. Read the comment docs.

@robertknight robertknight merged commit 3cb7464 into master Oct 30, 2020
@robertknight robertknight deleted the fix-prepend-test branch October 30, 2020 21:21
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.

1 participant