This is fabulous work, Gerben! Apologies for only just now following up.

I'm curious--from both you and Randall--what it would take to make Apache 
Annotator be the source of the libraries this Web extension depends on.

I know we still need to bring Randall's dom-anchor things "into the fold." 
However, I'm also curious what's different between your packaged version of the 
fragment identifier library and the one Randall did here. I'm guessing at least 
the ES6-ification?

The next steps--we seem to be having a hard time taking--is getting these 
libraries wrapped or added to the Apache Annotator repo + a similar factory 
style wrapper like the one you and Sasha have both created.

Help narrowing in on the differences will be useful.

Also, pull requests more than welcome! :)

Cheers!
Benjamin

-----Original Message-----
From: Gerben [mailto:[email protected]] 
Sent: Monday, May 29, 2017 3:20 PM
To: [email protected]
Subject: Precise-links browser extension

Hi all,

I have been silent here so far, but have been working a bit with Randall & 
Benjamin on our shared webby ambitions, and thought I'll share this one for 
your interests. At the I Annotate <https://iannotate.org> conference last month 
I made a simple browser extension to support Web Annotation Selectors in 
fragment identifiers, as specified in this W3C note 
<https://www.w3.org/TR/2017/NOTE-selectors-states-20170223/#frags>.
A location such
ashttps://en.wikipedia.org/w/index.php?title=Koala&oldid=781295795#selector(type=TextQuoteSelector,exact=fluffy%20ears)
<https://en.wikipedia.org/w/index.php?title=Koala&oldid=781295795#selector%28type=TextQuoteSelector,exact=fluffy%20ears%29>
will scroll to the words /fluffy ears/ and select them.

*Technicalities:*

The extension currently only supports TextQuoteSelectors using 
dom-anchor-text-quote <https://github.com/tilgovi/dom-anchor-text-quote>, which 
I abstracted through a minimal library I dub dom-anchor-selector 
<https://github.com/Treora/dom-anchor-selector>, with the intention of adding 
support for other selector types. I would be glad to have this library moved or 
rewritten under the Apache Annotator umbrella if there is interest.

The conversion between the selector as a javascript object and as a fragment 
identifier is done by code borrowed from Ivan Herman's converter 
<http://w3c.github.io/web-annotation/selector-note/converter/>, packaged as a 
module first by me here <https://github.com/Treora/selector-state-frags>, and 
again by Randall here 
<https://github.com/apache/incubator-annotator/tree/master/packages/fragment-identifier>
under the Apache Annotator project.

*Try it:*

For Firefox, available here
<https://addons.mozilla.org/en-US/firefox/addon/precise-links/>.

For Chromium, I yet only published it on my own server, here 
<https://temp.treora.com/precise-links.crx> for now. To install, download it 
and drag&drop the file to your list of extensions (chrome://extensions).

To create link to a segment of text, right-click the selection and choose 'Copy 
link to selected text'.

*Improve it:*

Extension code is here <https://github.com/Treora/precise-links>, though most 
improvements are to be done in the dependencies mentioned above.

It may be nice to also create a version of this code that people can easily 
include in their web pages, something I did previously with quoteurl 
<https://github.com/Treora/quoteurl>.

Cheers,

Gerben

Reply via email to