Settings

Theme

Did I reinvent the wheel? (JS plugin to link to page selection)

5 points by iafan 10 years ago · 5 comments · 1 min read


Spent quite some time looking for a JavaScript library that would allow me to select a part of a web page and send a link to that selection to someone else. I know there are scripts like AnchorJS that allow to deep-link sections and paragraphs, but didn't find any that would allow linking to a specific word, phrase or image.

So failing to find what I need, I wrote my own thing: https://github.com/iafan/LinkToSelection

Can't believe I'm the only one who thought about this — it seems to be super-useful for any documentation pages. Do you know of other implementations?

tonyle 10 years ago

Not many javascript stuff comes to mind, but you might find more implementations if you search for a specific problem you were trying to solve. The closing javascript thing that comes to mind is the letmegooglethatforyou site, an extreme way to point out the search button.....

From a personal point of view, Sometimes I would just email myself a link to a webpage if I wanted to view it later on mobile or vice versa.

In technical support over email, I used to send customers a link to a kb article or a pdf and a page number. I never had to go beyond something along the lines of, here is a link, you forgot to do step 4 or follow the instructions under the known resolution section.

From a bug reporting point of view, Most people would send a picture and send the dropbox link over slack/email. Dropbox has a little popup with the link to the image after taking a screenshot so it is very easy and fast.

It reminds me of Onenote and Evernote feature to copy snippets from a webpage, though I never tried to share the content.

While not directly similar, The code for searching for specific parts of a webpage seems similar to some web scraping solutions. Ie, here is a webpage, I want to scrape this selection for all similar pages,etc.

  • iafanOP 10 years ago

    I know that the best available option in today's world is to make a screenshot of a selection to point to a specific point on a page, but heck, this seems to be an extreme waste of bytes when the only thing you want to do is to point someone to a specific word or a phrase...

    The closest implementation that comes to my mind is GitHub's ability to select a line or a range of lines that would immediately update the hash and give you a permalink to the selection, e.g.: https://github.com/iafan/LinkToSelection/blob/master/lib/Lin... , and I think this is one of the small but handy features people love GitHub for, but it has a very specific use case and doesn't allow one to point to a range in the string, or just one character that, for example, is causing a problem.

accordionclown 10 years ago

related: > https://medium.com/the-bower/lets-please-use-hashtag-terms-t...

  • iafanOP 10 years ago

    Thanks for sharing. This proposal makes every bit of sense, IMO. I wish selection sharing could also be a part of some cross-browser standard so that people wouldn't have to install anything on their sites. It's one of the things that would just work if it was implemented universally across major browsers.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection