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

Mark text fragments #11

Open
kiru opened this issue Jun 11, 2020 · 8 comments
Open

Mark text fragments #11

kiru opened this issue Jun 11, 2020 · 8 comments

Comments

@kiru
Copy link

kiru commented Jun 11, 2020

Hello,

Chrome has a new feature which allows highlighting certain parts of the content.

Like this:
https://sometimesright.com/2020/04/25/blogging-vs-twitter/#:~:text=To%20me,quantity

It would be more user friendly to add the parts int he URL.

edit: they are called text fragments: https://twitter.com/david_bokan/status/1267902225281622020

@Fastidious
Copy link

Fastidious commented Jun 14, 2020

@kiru are you sure authors would want to include something that is browser specific? I agree that text fragments seems to enrich the web, but it is only usable in Chrome, and its derivatives (Edge, for example).

@caraya
Copy link

caraya commented Jun 15, 2020

@kiru I would also look at the issues raised in mozilla/standards-positions#194

@tomayac
Copy link

tomayac commented Jun 18, 2020

Tom here from the Google Chrome team. I came here to file exactly this issue… :-)

[A]re you sure authors would want to include something that is browser specific? I agree that text fragments seems to enrich the web, but it is only usable in Chrome, and its derivatives (Edge, for example).

The Text Fragments URL syntax will simply be ignored by browsers that don't understand it. Edge does support it, too. See my article for the full details. Happy to answer questions.

@Fastidious
Copy link

@tomayac no need to advertise your article, thank you.

We all know that browsers without Text Fragments implementation will ignore it. On my comment I wrote "it is only usable in Chrome, and its derivatives (Edge, for example)," so you are not adding anything new, other than trying to plug your article (which I will not read).

@tomcritchlow
Copy link
Contributor

@tomayac we are definitely exploring the idea of using text fragments. In practice however we've found the implementation incredibly inconsistent (see this post I wrote for more: https://tomcritchlow.com/2020/06/10/scrolltotextfragment/). Perhaps you can help us integrate it correctly into the app?

@Fastidious
Copy link

@tomcritchlow for what is worth, all the examples you provided on your post worked for me, using Chrome Version 83.0.4103.97 (Official Build) (64-bit) under macOS.

@tomcritchlow
Copy link
Contributor

@Fastidious indeed. Those examples are currently working for me too. The inconsistency drives me crazy. The same link on different days can work/not work.

@tomayac
Copy link

tomayac commented Jun 19, 2020

The inconsistency drives me crazy. The same link on different days can work/not work.

First, there is a known limitation with Text Fragments links not to work with JavaScript redirects as used on Twitter (https://t.co). Follow https://crbug.com/1055455 for details.

Second: there're some security restrictions in place: https://web.dev/text-fragments/#security (@[redacted], don't click this link, please).

@tomcritchlow All your examples in your article work when opened in a new tab.

[Y]ou are not adding anything new, other than trying to plug your article (which I will not read).

🕊 In order not to overly promote my article, here's the new bit, extracted exclusively for @[redacted]:

Text fragment directives are invoked only on full (non-same-page) navigations that are the result of a user activation. Additionally, navigations originating from a different origin than the destination will require the navigation to take place in a noopener context, such that the destination page is known to be sufficiently isolated. Text fragment directives are only applied to the main frame. This means that text will not be searched inside iframes, and iframe navigation will not invoke a text fragment.

Perhaps you can help us integrate it correctly into the app?

The code is open-source (@[redacted], sorry for plugging the repo):

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

No branches or pull requests

5 participants