
Show HN: Pinpointer – A Firefox extension to share links to page elements - Rumperuu
https://addons.mozilla.org/en-US/firefox/addon/pinpointer/
======
Rumperuu
I wanted to try making a browser extension and it seemed weird to me that
there didn't seem to exist any means of linking to specific elements on a web
page if they hadn't been given IDs to make a fragment identifier out of, so I
made this.

You select a page element and generate a link, which you can then share. For
someone without the extension, the link will work as normal and just take them
to the page, but someone with the extension will have the selected element
focused on and highlighted for them.

There's also a repo on GitHub (for now)[1] and I wrote about how I made it[2].
My next priorities are to make it not look like ass and to shorten the links
somehow. Let me know what you think.

[1]
[https://github.com/Rumperuu/Pinpointer](https://github.com/Rumperuu/Pinpointer)

[2] [https://bengoldsworthy.net/2018/04/developing-
pinpointer/](https://bengoldsworthy.net/2018/04/developing-pinpointer/)

~~~
karanlyons
You might want to take a look at
[https://github.com/karanlyons/pinpoint](https://github.com/karanlyons/pinpoint)
to see if there's anything there you want to grab, especially around the
selector creation:
[https://github.com/karanlyons/pinpoint/blob/4b2ec192c0400f26...](https://github.com/karanlyons/pinpoint/blob/4b2ec192c0400f26d7ff80ec3a652e467d5ee563/Pinpoint.safariextension/end.js#L98)

~~~
Rumperuu
This is really interesting, I'm not sure how I didn't find it before. What I'd
like to know is whatever happened to the CSS-selectors-as-fragment-identifiers
movement and why it didn't take off. The proposal that inspired that
extension[1] was written by Simon St.Laurent and Eric Mayer, so it's not like
it was a fringe thing, and they co-chaired a W3C Working Group on the
topic[2], but it apparently never published any reports and the last recorded
activity was in Jan 2013. Anyone know what happened?

[1]
[http://simonstl.com/articles/cssFragID.html](http://simonstl.com/articles/cssFragID.html)

[2]
[https://www.w3.org/community/cssselfrags/](https://www.w3.org/community/cssselfrags/)

~~~
karanlyons
Yeah, I dunno why it never took off, though Meyer was one of the few to star
the repo, so I thought that was nice. I was never able to get much traction on
my extension either, though some people did port it to every browser, which
was also nice.

I think this is just one of those problems that's hard to sell to people.

------
insomniacity
"It requires your permission to: Access your data for all web sites"

I wish Firefox had a permission along the lines of 'Access all data from pages
on which I activate the extension', which is presumably all this would need.

~~~
Rumperuu
As yoklov said, I had to have a small script[1] run a quick check on every
page you visit to check if the URL is a Pinpointer URL. As far as I can tell
there's no way around this (and I'd say breaking backwards compatibility with
HTTP is a bit drastic for a little browser extension like this).

[1]
[https://github.com/Rumperuu/Pinpointer/blob/master/content_s...](https://github.com/Rumperuu/Pinpointer/blob/master/content_scripts/checkPage.js)

~~~
ChrisSD
Could you not use webNavigation[0] to check the url and permissions API to ask
for permission[1] if necessary?

EDIT: Or tabs.onUpdated if webNavigation doesn't fire for hash changes[2]

[0] [https://developer.mozilla.org/en-US/Add-
ons/WebExtensions/AP...](https://developer.mozilla.org/en-US/Add-
ons/WebExtensions/API/webNavigation)

[1] [https://developer.mozilla.org/en-US/Add-
ons/WebExtensions/AP...](https://developer.mozilla.org/en-US/Add-
ons/WebExtensions/API/permissions)

[2] [https://developer.mozilla.org/en-US/Add-
ons/WebExtensions/AP...](https://developer.mozilla.org/en-US/Add-
ons/WebExtensions/API/tabs/onUpdated)

------
mosselman
A video or a few screenshots would help me understand how it works better and
probably help with the number of installs.

------
severine
I have installed it and it doesn't work.

In the Mozilla addons page it just says " _Pinpointer error_ ".

In this HN page, it prompts me to select and click a green button, but fails
to do anything.

It's an interesting concept, keep going!

edit: Firefox 62.0b9 (32-bit) in up-to-date Ubuntu 16.04, with uMatrix and
other extensions running.

~~~
Rumperuu
As far as I can tell the Mozilla addons page doesn't like addons running on
it. I'll add a more explanatory error message though. I hadn't thought to test
it on HN, so that's intriguing. I'll look into it, but I'd presume it's due to
some sort of quirky DOM structure.

~~~
ChrisGranger
There's an about:config entry regarding this.

extensions.webextensions.restrictedDomains

------
miga
Great fix for one of biggest web usability issues when quoting, and
referencing complex documents.

