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

Perform Chrome version check to enable highlighting using text fragments #35633

Merged
merged 6 commits into from
Aug 12, 2021

Conversation

dmanek
Copy link
Contributor

@dmanek dmanek commented Aug 11, 2021

Partial for #32139.

Copy link
Contributor

@kristoferbaxter kristoferbaxter left a comment

Choose a reason for hiding this comment

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

Left a small comment but otherwise looks great!

// `'fragmentDirective' in document = true` which breaks feature detection.
// Chrome 93 supports the proposal that works across iframes, hence this
// version check.
if (platform.isChrome() && platform.getMajorVersion() >= 93) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also include the feature detection? After a bit we can remove the Chromium 93 hard coding and rely solely on feature detection.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

this.ampdoc_.win
);

// Chrome 81 added support for text fragment proposal. However, it is
Copy link
Contributor

Choose a reason for hiding this comment

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

Great comment that explains the scenario well. Thanks!

}
);

// TODO(dmanek): remove `ifChrome` once other major browsers support text fragments
Copy link
Contributor

Choose a reason for hiding this comment

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

If we retain the feature detection, would we need to run this test against Chromium only?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. If we were not doing Chrome version detection, this could be removed. I've updated the TODO.

@dmanek dmanek enabled auto-merge (squash) August 12, 2021 21:29
@dmanek dmanek merged commit 481b4e6 into main Aug 12, 2021
Copy link

@gifhuppp gifhuppp left a comment

Choose a reason for hiding this comment

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

1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants