Long web pages can have anchors inserted into them for example at the beginning of each section or paragraph.
<a id="proposition 1">The reason this is done is so that a user can click once to jump straight to the section so identified. A URL can be generated such as <https://hb.co/um#conclusion> and this URL does not point to the top of the page but points specifically to the anchor part way down.
<a id="proposition 2">However there is a problem here, you cannot specify a URL that points to the conclusion section if the person writing the page has not included the id= tag in their page.
<a id="corrolary">Therefore it is proposed that the official standards are emended such that any text or content on the page can be used as an anchor. I supose a different syntax would be required so as to make a URL pointing to a code anchor differ from a URL pointing at a text anchor. For example, the code to jump-link to an arbitrary text could have a double hash sign e.g. https://hb.co/um##supose_20a_20dif
<a idea="corrolary 2">An alternative syntax could use a double hash mark to jump to a percentage of the page height as rendered in the browser, e.g. <https://hb.co/um##72%> would jump 72% of the way down the page.-- pocmloc, Oct 17 2022 #:~:text=<first word>,<last word> https://infinity.fa...dogs%20and%20drones(while using Chrome on a desktop, click the link for example) [Mindey, Oct 19 2022] Apr 2021 article on new 'link to section' feature - Mint https://www.livemin...11618809560498.htmlOn new 'link to section' feature being rolled out in Chrome at the time [Loris, Oct 21 2022] Nov 2021 article - Business insider https://www.busines...leshow/87881538.cmson improvements to copy link to highlight feature introduced earlier in year [Loris, Oct 21 2022] N-prize; Max valentine2020 test 1 N-Prize#1650985177#...c%20Feb%2014%202020manually encoded test link [Loris, Oct 24 2022] N-prize; Max valentine2020 test 2 N-Prize%23165098517...c%20Feb%2014%202020test with url-encoded 'halfbakery hash' [Loris, Oct 24 2022] i feel like there will be a lot of brokenness and unexpected landings, but I enjoy the laziness of the idea. To improve perhaps the anchor is actually a search term, which can take into account misspellings, for those of us who around suppertime grow short on consonence.-- mylodon, Oct 18 2022 [a1] I don't think it is possible to include the javascript into a URL though so it doesn't solve the use-case I presented.
e.g. suppose I want a one-click answer to open the N-Prize idea and jump to the comment written by [MaxwellBuchanan] on Feb 14 2020.-- pocmloc, Oct 19 2022 Yes that's a lovely url you provide but no that's not what I don't think is possible.-- pocmloc, Oct 19 2022 Yeah, running javascript on the destination of a link is I think pretty obviously a security issue.
Even javascript in links on the same page is probably a bit of an issue for websites which allow arbitrary links to be made, to be honest.-- Loris, Oct 19 2022 Oooo nice. Thank you. We are getting there.
Now need this to be adapted and finessed into a standard and for other browser developers to incorporate it.-- pocmloc, Oct 20 2022 //At this point your idea sounds less like an invention and more of a call to expand / standardize an existing capability. A digital lets all, so to speak.//
That's not a fair assessment, since pocmloc obviously wasn't aware of this feature when they posted the idea. And it's clearly not widely known to exist. It's not even exposed as a user-friendly function.-- Loris, Oct 20 2022 //I'd say it's widely known to exist except to people who don't use Chrome*. And Google** routinely returns search results with text fragment links so when you click on them it jumps to the right spot*** - is that exposure user friendly enough?//
Yes, it occurred to me after seeing it that Chrome sometimes does something similar with search results. I'm not exactly sure what induces it though; it doesn't do it with arbitrary requests for me.
No, that doesn't constitute a user-friendly interface. The fact that your "one click" link is currently broken shows that it's not easy to do. (edit: working now) A friendly interface would be something like selecting the text you want to link to, and clicking a button in the browser window (or using a keyboard shortcut, or a drop-down menu option, etc) to reliably generate the link.
Furthermore, it does kind of need to be in the standard. There are widely-used browsers like firefox missing from your list. The browser wars were a dark time, with Microsoft fucking things up by trying to embrace and extend every interface they could.-- Loris, Oct 20 2022 // Surprise! Chrome and Edge both do exactly that. Highlight any text, right click, and there's a popup with an option to "Copy link to highlight."//
Huh. True. Excellent point. Conceded.
//I'm not against this becoming standard in more browsers. But saying it's not widely known to exist (IN THE MOST WIDELY USED BROWSER IN THE WORLD!) is a bit weak//
So if it was /so/ widely known, how come you were inclined to "muddle along with poorly thought out javascript"?-- Loris, Oct 20 2022 Now I'm wondering how long this feature has been there; it's going to be so damn handy. (A quick search suggests this was a new feature in April 2021, so it's about 18 months old.)
But I honestly don't think it's that widely known. Give me a moment... Nope, neither of my children knew about it either. (update - I asked my wife and she didn't know, but found it experimentally on asking.) I think the issue is that it's not obvious what it does from menu entry ("Copy link to highlight") - until you know what it does. I've probably seen and ignored it dozens of times, assuming it was some sort of internal scratch-pad or something (i.e. the meaning was {store a link to the current page in "my highlights"}). The fact that it doesn't show up unless you've selected something probably doesn't help discoverability either, but that's a Windows UI defect as much as anything.-- Loris, Oct 20 2022 //Er... It's a feature that only makes sense only when you HAVE some text of a web page selected. How would you make it more "discoverable" than having it appear on a context sensitive menu?//
Under RiscOS, menus would have functions which didn't make sense in the current context greyed out. There are probably other ways to do it.-- Loris, Oct 20 2022 //I prefer those menus to just show available actions for the current context. A potentially long list of "you can't do that right now" actions is really annoying.//
Sure- it would be, but if there were lots of actions they'd go on sub-menus, and they were pretty responsive so that wasn't a problem in practice.-- Loris, Oct 20 2022 Trying to read this makes something in my head hurt.I will try again to understand tomorrow.-- 2 fries shy of a happy meal, Oct 21 2022 //this makes something in my head hurt//
Somewhere in the Beyond, a ghostly Borg adjusts a dial with a smile of deep contentment.-- pertinax, Oct 21 2022 1. The partial solution discovered by our intrepid explorers is a fancy propriatry add on for a particular web browser, not a universal standard, and as such it can be safely ignored or at least looked at with a quizzical expression and a kind of noise halfway between hmmm and harrumpf. 2. It makes the linked text highlighted which is not part of the original proposal (could be an optional extra using a little extra code) 3. It doesn't address the other half of the presented idea which is the percentage anchor.-- pocmloc, Oct 21 2022 Thought this was going to be a new universal type of boat anchor that would secure any vessel regardless of size.-- xenzag, Oct 21 2022 //there will be a lot of brokenness and unexpected landings, but I enjoy the laziness of the idea//
There might be a plot for a soap opera in there somewhere.-- pertinax, Oct 21 2022 //Correction: Since 2020...//
Correction to your correction - you mean 2021. A simple web search will find many articles from April 2021 reporting on the roll-out of this feature.-- Loris, Oct 21 2022 //It was part of Chrome release 80, which came out in February 2020.//
Hmm. Curious. There /are/ many articles describing the new feature in Chrome being rolled out in April 2021. For example this one (link)
//Google's new feature will let you share highlighted text on webpage <updated 19 Apr 2021> Google is planning to roll out a new feature for its extension- Chrome 90 that will allow users to create a link to a section of a website that they have highlighted earlier. ... This feature is, however, rolling out to some users as an experiment. Google said the copy link to highlight" feature is already available on desktop and Android devices for some users.//
and this one:
//Google is expanding its copy link to highlight feature to photos and videos <NOV 24, 2021, 10:11 IST>Google earlier this year introduced a new feature called copy link to highlight that lets you create a link to a certain section of the webpages text thats highlighted.//
Perhaps it was the menu option "copy link to highlight" which was introduced then? The 'link to specific text' would have been in place for some time beforehand, but realistically the syntax is too involved for everyone but particularly dedicated html geeks and automated systems. After investigating a little, I think that's it. The feature is more involved than the initial description - it expands the search-text description to exclude copies of the selected text further up the page.-- Loris, Oct 21 2022 "I'm a doctor Jim, not a programmer..."-- 2 fries shy of a happy meal, Oct 22 2022 // Pretty sure it's due to how HB uses the reserved # symbol for itself.//
I'm gonna try testing some stuff, hang on.
Okay, wouldja try the test links I posted today in Safari? Both work in Chrome. The first one just includes the idea number missing from your example link. (It turns out this is optional, so it might just be that somehow something gets confused if it gets replaced by something else.) The second one url-encodes the hash which precedes that.-- Loris, Oct 24 2022 Oh well never mind then.-- Loris, Oct 24 2022 The thing I wonder about with halfbakery links is what the number is /for/. I mean, it's not mandatory, a link will work just fine without it. And it doesn't seem to be doing the official purpose of linking to a position on the page. I thought it might be a way of providing resilience against the name of the idea changing (hence changing the main url) - but it doesn't seem to.-- Loris, Oct 25 2022 random, halfbakery