Live data from Hacker News

Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

alfy.blog

121–130 of 145 posts

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#121
post #52

It’s really cool but it seems rather convoluted for the typical user. We should perhaps start making good use of the ID attribute and linking to that first before we start trying to use ~:text=

It's literally three clicks... Select text, right click, create link to selection. I agree you should prefer IDs but they aren't always available, and often using them is very convoluted for users (how many are going to know how to use the element inspector, or even what an ID is?).

It's not difficult for you and me, sure. Try explaining you need to add a tilde, colon, the work text, equals sign then the text you want to the end of the URL.

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#122
post #121

Earlier quoted context omitted.

It's literally three clicks... Select text, right click, create link to selection. I agree you should prefer IDs but they aren't always available, and often using them is very convoluted for users (how many are going to know how to use the element inspector, or even what an ID is?).

It's not difficult for you and me, sure. Try explaining you need to add a tilde, colon, the work text, equals sign then the text you want to the end of the URL.

Why can't the browser do all of that when you create a link to the selection?

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#123

Earlier quoted context omitted.

FYI, the "standard doc" isn't in any sense standardised yet https://wicg.github.io/scroll-to-text-fragment/ > This specification was published by the Web Platform Incubator Community Group. It is not a W3C Standard nor is it on the W3C Standards Track.

Isn't Web Platform Incubator Community Group the group browsers makers formed because the W3C was being too slow and then largely overtook the W3C in terms of relevance?

No, I would say you were describing WHATWG and their HTML5 specification (now called the HTML Living Standard)

https://en.wikipedia.org/wiki/WHATWG

The Web Platform Incubator Community Group is "a lightweight venue for proposing and discussing new web platform features" within the W3C

https://www.w3.org/community/wicg

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#124

In all honesty, I've hated this feature with a passion ever since it appeared. If it was simply a matter of being used in the way outlined in the article, when someone creates a a link that references a particular piece of text, then fine, someone has deliberated intended the link to behave like that. And then we have the lovely folk at Google search... who think it's fun to drag my attention off to a random part of…

Sounds like your problem is with a Google product more so that the browser feature itself. I for one can't wait to start using these kinds of deep links. I love when websites have "copy link to header" buttons, but even when they do I often want to link to a particular sub-paragraph or sentence as a citation... and now I can!

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#125
post #121

Earlier quoted context omitted.

It's literally three clicks... Select text, right click, create link to selection. I agree you should prefer IDs but they aren't always available, and often using them is very convoluted for users (how many are going to know how to use the element inspector, or even what an ID is?).

It's not difficult for you and me, sure. Try explaining you need to add a tilde, colon, the work text, equals sign then the text you want to the end of the URL.

You're missing that Chrome has this built in to the context menu. My dad has been sending me links like this for years now, they just haven't worked for me until this month because I use Firefox.

I'm assuming Firefox has this context menu feature on the road map as well, though I suspect it will be a long time before Safari adds it just because Apple.

The average person doesn't even understand a URL at all—as far as they're concerned they're generated by computers for computers and are copied around with little regard for what the various components mean. This feature doesn't change that, it just gives a new way of creating a URL that does something slightly different.

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#126

Earlier quoted context omitted.

Hijacking CTRL+K sucks, too! It's the shortcut used to focus the browser search input in Firefox, but the industry has seemingly decided it's a great way to launch a command palette.

I recently implemented this, and the users loved it, though I was disappointed to hear it may have frustrated a usually silent group. I'm open to feedback! What would be a better approach? Please don’t just suggest “no custom shortcuts for any web app”—people spend 60-70% of their workday using the UI components my team maintains. While random sites hijacking shortcuts is definitely frustrating, in our case, the pros…

> Honestly, I think the web platform could use a standard API for defining shortcuts, with browsers providing a UI to manage or disable them. Maybe I'm still over-engineering here.

I think this is really cool and would also allow some interesting features...

- Easier using random input devices. Game engines like Unity with their newest input manager abstracts everything away. Bind inputs not only to standard navigation actions but also app-defined shortcuts.

- Custom UI provided by the browser based on available shortcuts. PCs could get a quick actions bar and phones could have a shortcut drop-down menu exposing functionality.

- If there is an API for enabling/disabling shortcuts the browser can provide context-sensitive shortcut suggestions like some of the profession creation tools like Fusion360 [iirc] where available shortcuts are shown in the status bar.

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#127
Looks like Firefox is lagging behind. It understands the url but there doesn't seem to be a way to create it from the UI. Chromium has "Copy link to highlight" in the right click/context menu but Firefox 131.0.3 doesn't. There is an add-on though: https://addons.mozilla.org/en-US/firefox/addon/link-to-text-...

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#128
post #78

Earlier quoted context omitted.

CTRL+L works for that too on Chromium / Firefox.

Not if you choose to have separate URL and search bars. In that case, Ctrl-L goes to the URL bar, and Ctrl-K goes to the search bar.

At least in Firefox there is still a difference even if you don't have a separate search bar. Ctrl-K goes to the URL bar as a search in your default search engine while Ctrl-L goes to the URL bar in whatever mode it currently is in. This mostly matters if you disable searching by default in the URL bar but still search from the URL bar, although there is also a visual indication that you are searching with Ctrl-K in the default configuration.

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#129
post #94

Unsurprisingly this is something you could do in Plan 9: /path/to/file:/from.*to opens the file and sets the selection to the range of text between "from" and "to". Bonus: you can use regular expressions. It pains me to see the web having strayed so far from its focus on interlinking. It's easy to make a parallel when on one side device makers have taken control back by removing access to files and putting applicatio…

vim users may be pleased to know that this can be done when vim is invoked from the command line, via the +/{pat} option. Sadly doesn't work for gF (yet).

See also hyperbole for emacs.

Re: Smarter Than 'Ctrl+F': Linking Directly to Web Page Content

#130
post #23

> Text fragments are currently supported in all the browsers. All meaning all the browsers listed in the linked table. These may be the major browsers, but not all of them.

Brave has this feature disable due to (rather minor, imho) privacy concerns. https://github.com/WICG/scroll-to-text-fragment/issues/76 https://github.com/brave/brave-browser/issues/17994

That is an interesting issue (detect differing resource loading based on the document jump) that affects regular fragments as well, but the idea is that particularly sensitive pages would know not to have fragment targets in the page but couldn't prevent text fragments. The solution given (deterministic loading independent of jump target) seems like a good idea to work towards but meanwhile I agree it is a minor concern and pages should not avoid reasonable navigation due to this issue. Particularly since there are often other ways of getting the same information with the same type of network analysis.
Post reply on HN