beakerbrowser / beaker

An experimental peer-to-peer Web browser
https://beakerbrowser.com/
MIT License
6.75k stars 548 forks source link

navigator.registerProtocolHandler doesn't seem to be handled properly #1060

Open Gozala opened 6 years ago

Gozala commented 6 years ago

As me and @jimpick discovered over at IndieWeb Camp lot of interactions in that space depends on navigator.registerProtocolHandler API. For simplicity I'll give an overview of commenting on someones indie website but bunch of other interactions work the same.

In the indieweb when you want to comment on someone's (indie)website you actually create a comment on your own (indie)website and then send a webmention to the target pointer to your comment.

For a seamless UX they use following configuration:

  1. Individual owning (indie)website will register own site as indie action handler via registerProtocolHandler
    navigator.registerProtocolHandler('web+action', 'https://mysite.com/port.html?handler=%s', 'me');
  2. (Indie)website that enables seamless commenting will have say "post comment" button which onclick creates hidden <iframe src="web+action:load" /> and will postMessage to it a message containing comment, target url, etc...
  3. That will enable port.html to save the comment on owners website + send webmention.

Important detail here is that target site does not know the commenters or where that comment is going to go, since commenter configures web+action independently. Me and @jimpick were trying to use beaker, in order to register web+action handler to a dat page that would just then save comment into personal archive. We were able to register a protocol handler, but when loading web+action:load beaker was not resolving that URL to anything.

@jimpick If I recall correctly you have actually created a dat site for this example, would you mind sharing it here ?

Gozala commented 6 years ago

/cc @tantek

pfrazee commented 6 years ago

I'd like to give this a look. I've been thinking about an intents scheme and this has some clear similarities.

Gozala commented 6 years ago

Here is the electron issue about navigator.registerProtocolHandler, still reading through it.

Gozala commented 6 years ago

While above mentioned issue referred to navigator.registerProtocolHandler it was actually about ability to register electron app as an OS level handler for protocol schema addressed by app.setAsDefaultProtocolClient API.

So I have submitted this one instead https://github.com/electron/electron/issues/14956