Peertube: WebExtension to enhance federated experience

Created on 16 Oct 2018  路  6Comments  路  Source: Chocobozzz/PeerTube

Well, that's an idea I just got (I have more ideas in the pipeline, longer-term), and might be worth a discussion here.

Currently, if you land on a peertube page from a link, you need to replace the beginning of the URL to interact with it from the home server of your choice, which is a subpar experience.

Solving this issue might be worth a W3C standard, but for now, a web extension would certainly be a good way to prototype something that works well.

Currently there are two ways to store user settings:

  • Cookies
  • Local storage

Both of these are URL-specific, and giving websites unrestricted access to those would likely be a privacy issue.


I would suggest a workflow as follows:

  1. The user visits a PeerTube website
  2. The user is prompted to choose whether to remain on it, or visit it with the identity of one of the other instances:

    • a list should be displayed, maybe like Google's profile list

    • but websites shouldn't be able to read it for privacy concerns

    • as such, it should completely be handled client-side, maybe in something like a permission dialog

    • maybe add an option to remember the choice

  3. If the user chooses so, it is either (TBD):

    • redirected to his home instance

    • presented with the same interface, but every API call is directed to his home server instead.

    • this might make for a better user experience, while keeping the user's choices private from the host instance.


An alternative to a webextension might be to proxy everything to a "multiplexer", which would be an URL like peertube-chooser.net, that would store cookies for the same purpose, and serve javascript to proxy the API calls. This might be simpler to implement, and work with everyone, but:

  • Could be a bit less private, as some JS might read the resulting DOM, as far as I know
  • would sort of defeat the purpose of a federated service if a centralised server is needed for co-ordination.

Of course, everything here can later be extended to other federated projects: mastodon, Matrix, diaspora, GNU social, etc.

Type

Most helpful comment

@rigelk sort of. This is nice when you want a remote follow link, but not if you want the browser to be able to present a fallback.

Ideally, we would have something like:

<link href="web+peertube://video:da2b08d4-a242-4170-b32a-4ec8cbdca701" rel="alternate" type="federation/peertube">

This is a random example, there are many ways this could be implemented. In the above example, this would need a simple adjustment of the specification so that web browsers offer to open the page with one of their protocol handlers, if there is any available.

mockup-share

Of course, the workflow isn't perfect nor completely clear to me, I think I just need to think more about this, and let it sit for some some time. Ideally, this would be a generic way to solve the problem, but more standardisation of the various ActivityPub platforms is probably something to look into.

Together with a webextension, more information could be added to the various links:

<a _ngcontent-c3="" routerlink="/videos/overview" routerlinkactive="active" href="/videos/overview" peertube-link="web+peertube://nav:videos/[email protected]"><span _ngcontent-c3="" class="icon icon-videos-overview"></span><!---->Overview</a>

@Chocobozzz & co, go take your days off, you deserve them :D

All 6 comments

Have you heard about peertubeify?

No, I hadn't seen it, thank you. Although it doesn't seem to fulfil every requirement I stated above, it seems like a step in the right direction, and is quite promising.

In the longer term, I would like to come up with a standard cross-browser API for that kind of optional feature (sort of how mailto: links are handled in Firefox, but less intrusive, and still supported by the browser itself by default).

@MayeulC isn't it the goal of protocol handlers? https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler/Web-based_protocol_handlers

As a side note, it is not supported among all browsers: https://caniuse.com/#feat=registerprotocolhandler

Mastodon implemented it for a few purposes, check if that matches yours: https://github.com/tootsuite/mastodon/pull/4511

@rigelk sort of. This is nice when you want a remote follow link, but not if you want the browser to be able to present a fallback.

Ideally, we would have something like:

<link href="web+peertube://video:da2b08d4-a242-4170-b32a-4ec8cbdca701" rel="alternate" type="federation/peertube">

This is a random example, there are many ways this could be implemented. In the above example, this would need a simple adjustment of the specification so that web browsers offer to open the page with one of their protocol handlers, if there is any available.

mockup-share

Of course, the workflow isn't perfect nor completely clear to me, I think I just need to think more about this, and let it sit for some some time. Ideally, this would be a generic way to solve the problem, but more standardisation of the various ActivityPub platforms is probably something to look into.

Together with a webextension, more information could be added to the various links:

<a _ngcontent-c3="" routerlink="/videos/overview" routerlinkactive="active" href="/videos/overview" peertube-link="web+peertube://nav:videos/[email protected]"><span _ngcontent-c3="" class="icon icon-videos-overview"></span><!---->Overview</a>

@Chocobozzz & co, go take your days off, you deserve them :D

See https://docs.joinpeertube.org/#/use-third-party-application for available browser addons

@Chocobozzz an alternative I since thought about in the context of Matrix was to actually use a protocol handler, as suggested by @rigelk, but also submit PRs to the various web browsers to add a webpage (similar to https://matrix.to) that explains how to join the network as a default protocol handler.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zilti picture zilti  路  3Comments

milleniumbug picture milleniumbug  路  3Comments

Jorropo picture Jorropo  路  3Comments

XenonFiber picture XenonFiber  路  3Comments

tcitworld picture tcitworld  路  3Comments