Half a croissant, on a plate, with a sign in front of it saying '50c'
h a l f b a k e r y
Superficial Intelligence

idea: add, search, annotate, link, view, overview, recent, by name, random

meta: news, help, about, links, report a problem

account: browse anonymously, or get an account and write.

user:
pass:
register,


                                                                                                                     

universal anchor link or jump link

anchor link or jump link that works on any page in the universe
  (+7)
(+7)
  [vote for,
against]

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

<a=bottom> javascript:window.s....body.scrollHeight)
jump to bottom using javascript [a1, Oct 18 2022]

<a=top> javascript:window.scrollTo(0,0)
and up goes the donkey [a1, Oct 18 2022]

HREF using JavaScript https://blog.udemy....tion%20in%20action.
[a1, Oct 19 2022, last modified Oct 21 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]

“One click … N-Prize#/#:~:text=M...c%20Feb%2014%202020
… to open the N-Prize idea and jump to the comment written by [MaxwellBuchanan] on Feb 14 2020.” [a1, Oct 20 2022]

Let’s all (use Chrome) https://www.halfbak...:~:text=let's%20all
the author wants something some people are already doing to be more widely practiced [a1, Oct 20 2022]

proposal for adding support for specifying a text snippet in the URL https://github.com/...ll-to-text-fragment
[a1, Oct 20 2022]

Available Chromium browsers https://en.wikipedi...web_browser)#Active
[a1, Oct 21 2022]

Chrome Release 80, Feb 2020 https://www.bleepin...he%20website%20URL.
The new Chrome version also enables authors and users to link to a specific portion of a webpage by adding a text fragment from the page to the website URL. [a1, Oct 21 2022]

And mentioned in 2019 https://www.bleepin...an%20just%20Chrome.
"Google has been working on this feature since January 4th 2019 and hopes to make this part of the standards process so that it is available to all browsers, rather than just Chrome." [a1, Oct 21 2022]

Apr 2021 article on new 'link to section' feature - Mint https://www.livemin...11618809560498.html
On 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.cms
on improvements to ‘copy link to highlight’ feature introduced earlier in year [Loris, Oct 21 2022]

Does your browser support URL Scroll-To-Text Fragment? https://caniuse.com...ll-to-text-fragment
nearly 3/4 of web users already have this. [a1, Oct 23 2022]

Safari 16.1 update https://ios.gadgeth...wser-needs-0385203/
[a1, Oct 23 2022]

N-prize; Max valentine2020 test 1 N-Prize#1650985177#...c%20Feb%2014%202020
manually encoded test link [Loris, Oct 24 2022]

N-prize; Max valentine2020 test 2 N-Prize%23165098517...c%20Feb%2014%202020
test with url-encoded 'halfbakery hash' [Loris, Oct 24 2022]

URI Fragment https://en.wikipedi...g/wiki/URI_fragment
[a1, Oct 25 2022]

[link]






       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
  

       Like mylodon, I see a potential to break things, so [+]. Until there’s a standard way of breaking things, I’ll muddle along with poorly thought out javascript. (links)
a1, 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
  

       // I don't think //   

       Oh, I wouldn't go that far. But you *could* look it up (link).
a1, 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
  

       // a pretty obvious security issue //   

       So? Doesn't mean it can't be done. That's what javascript is for, to try security analysts' patience.
a1, Oct 19 2022
  

       // a one-click answer to open the N-Prize idea and jump to the comment written by [MaxwellBuchanan] on Feb 14 2020. //   

       Will you be offering a prize for that?
a1, 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
  

       // need this to be adapted and finessed into a standard and for other browser developers to incorporate it //   

       Hmm. Chromium based browsers already have about 2/3 of the world market share. And it’s not uncommon for web designers to put notices on their pages saying “This page best viewed in Chrome.” At this point your idea sounds less like an invention and more of a proposal to standardize an existing capability. A digital “let’s all,” so to speak.
a1, 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 “let’s 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
  

       [Loris], I guess we're applying different standards here. 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?   

       But baking/learning is iterative. [pocmloc] didn't know about it when he first posted. Now we all do.   

       * Chrome, Edge, and other Chromium based browsers
** Bing does also, I think
*** As long as you're using a supported browser
a1, 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
  

       // 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. //   

       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."   

       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.
a1, 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
  

       // how come you were inclined to "muddle along with poorly thought out javascript" //   

       Because I like poorly thought out javascript?   

       No, it's a few other things 1) I didn't fully understand [pocmloc]'s requirement - getting to that was an iterative process also - and 2) Despite using Chrome & Edge at the office, I use mainly Safari (the SECOND most widely used browser) on my own devices. And 3) as if I need another excuse :) I'd say this goes back to your comment about it needing to be user friendly. This feature is so "user friendly" it's moved into the realm of invisibility or magic. It just works, and I don't think about it unless we draw a sharp outline around it and poke it with a stick.
a1, 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
  

       As 8th isn't here to say it, I'll need to relate this back to Star Trek.   

       CAPT KIRK : [handing Chekov a container] Mr. Chekov, what do you make of this?   

       CHEKOV : Oh, quadrotriticale. I've read about this, but, er, I've never seen any before.   

       CAPT KIRK : Does everybody know about this wheat but me?   

       CHEKOV : Oh, not everyone, Captain. It's a Russian inwention.   

       —The Trouble With Tribbles, ST:TOS, 1967   

       LORIS : Does everyone know about this browser feature except me?   

       A1 : Oh, not everyone, Loris. It's a Google inwention.
a1, Oct 20 2022
  

       // 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. //   

       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? An animated paperclip perhaps, showing up unbidden to say "Hey, wanna see a neat trick?"   

       Windows UI defect or not, it's the same in Chrome for Mac, iPhone, and iPad. Have to ask some Android user to be sure but I reckon it's the same there.
a1, 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.   

       To each their own, I guess.
a1, 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.
  

       //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
  

       // a fancy propriatry add on for a particular web browser //   

       Correction: Since 2020 it’s been an intrinsic feature in Chrome and every browser based on the Chromium code base. That’s a long list (linked). It’s actively used in search results presented by both Google and Bing, but only users of supported browsers (about 2/3 of the web browsing world) benefit from it.   

       That’s not niche, it’s mainstream.   

       // the other half of the presented idea which is the percentage anchor //   

       Heh, that was the part I originally addressed, several days ago. May I interest you in some poorly thought out javascript?
a1, 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
  

       Corrected corrected correction? It was part of Chrome release 80, which came out in February 2020. Links provided - but you'll need a supported browser to automatically scroll to the relevant text :D
a1, 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 webpage’s text that’s 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
  

       In any case, it's been around longer than [pocmloc]'s suggestion, but still doesn't support his "percentage anchor." For that, some poorly thought out javascript is still in order...   

       function universalJump (destPage, destJump) {
// open destPage in new tab or window (if not pointing to _self)
// parse destJump as id, text fragment, or percentage of vertical scroll area - and scroll to there
}
a1, Oct 21 2022
  

       "I'm a doctor Jim, not a programmer..."   

       I just updated my iPhone to iOS 16.1. Scroll to text fragment works natively in Safari now. Webkit and Chromium support combined means it's available to around 90% market share, I think. Enough to call it a de facto standard.   

       Are you sure I can't interest you in some poorly thought out javascript for "scroll to percentage" though?
a1, Oct 24 2022
  

       // works in Safari now //   

       Except for text fragments in Halfbakery ideas!   

       I tested the link to the "let's all" section of the help file - that jumps to the right place. But the link to the text fragment in MaxBuchanan's N-Prize post didn't. Pretty sure it's due to how HB uses the reserved # symbol for itself. Chromium based browsers ignore it and keeps looking for the one that signals the text fragment, but Webkit doesn't.   

       So much for de factor standards.
a1, Oct 24 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
  

       Both open but neither scroll to the intended fragment.
a1, Oct 24 2022
  

       Oh well never mind then.
Loris, Oct 24 2022
  

       Sounds like a job for [jutta] but I think it's such an odd case that she mightn't bother to fix. If you could close a base HB link with a simple / instead of #/ I reckon the text fragment suffixes would work.
a1, Oct 25 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
  

       The #number at the end of a link is the timestamp of the latest comment. The # itself is a "fragment identifier," which I think means something like "everything after this point may be changed without reloading the page" but of course there are much longer explanations available.
a1, Oct 25 2022
  
      
[annotate]
  


 

back: main index

business  computer  culture  fashion  food  halfbakery  home  other  product  public  science  sport  vehicle