You are reading content from Scuttlebutt
@SoapDog %OrZtPhIz2MrG3xdBrOTmqIitLuSNsVhMZnYEfIqUCv0=.sha256

SSBC grant proposal - Add SSB features to Firefox

This proposal is for creating an add-on (or multiple) for #Firefox using the WebExtension APIs to add some scuttlebutt features to the browser.

Motivation

At the moment, there are two main ways of interacting with scuttlebutt: running an electron based app or running some form of server and opening a local webapp. In the first case, your scuttlebutt experience is decoupled from your web experience which is at the same time good and bad. In the second case, even if you're using scuttlebutt from a tab in your browser of choice, it doesn't interact with the remaining web experience you have while using the browser. The creation of this (these) add-on, would make possible new experiences and features that are not easy done with the above mentioned ways of running scuttlebutt. I'd like to summarize some reasons why I believe this is a good idea:

Richer interaction with the browser

Using an add-on allows us to tap into APIs that are not available to normal webapps. It opens possibilities for contextual menus, browser buttons, sidebars, and other UX experiences. For example, a compose message window on a sidebar allows you to change your active tab while still composing the message, thus making it a lot easier to compose entries that carry content from multiple sources and to fact-check stuff while you're posting.

Allows us to run one less web engine

There are too many electron based apps in our daily usage. Many of us (me included) are running an editor such as visual studio code or atom, slack, spotify, patchwork, trello app, and each of those apps is one more chrome engine running. Chrome is not known for being a diet browser, if we could run one less instance of chrome, that would help our machine.

Investigate new usage patterns

As this deeper integration opens up new possibilities of usage (mostly by reducing friction), new forms of interaction between the current web and the decentralized web might be investigated. Having a decentralized technology inside a major browser will probably lead to new usage patterns beyond what we have seen so far.

Pave the way for more decentralized features inside major web browsers

Once completed and working, the method of adding ssb features to Firefox will make it easier to add features from other dex solutions such as dat and ipfs, which could lead to larger and more frictionless adoption of those technologies as well.

WebExtensions are a standard

The new add-on API called WebExtensions is basically an standard. The API is shared between Firefox, Chrome, Opera and even Edge and Vivaldi. Each browser has some APIs that are not present in the others but it is a lot easier to port between browsers than it was when each used their own API. This work could later be used in porting the add-ons to other browsers.

What I will build

Due to the lack of TCP and UDP APIs in WebExtensions, we'll use native messaging api to talk to a native companion app built with NodeJS which will have sbot and friends as a dependency. All the ssb features are provides by this companion application which does IPC with add-ons over standard input and output, websockets and HTTP.

A major add-on called patchfox is planned and will provide features that ressemble patchwork/patchbay/patchfoo. We can think of pathfox add-on as a client for scuttlebutt.

Other smaller add-ons might be built if there is time and money to cover features beyond normal patchwork-like usage such as git-ssb, bookmarks and #ticktack

How the money will be used

The money will be used to cover my time as a part-time worker and any other professional I might need to hire (such as buying some custom graphical designs for icons and other GFX).

Why me? Why I need the grant?

Since I started here on patchwork not long ago, I have been building simple experiments talking with sbot from other languages (mostly #red and #webextensions). My investigations proved that it is possible to build a custom scuttlebutt client as an add-on and I'd like to have the resources to build this correctly.

I am a Mozilla Rep and a Mozilla TechSpeaker. I wrote the first book about Firefox OS in the world back when the project was alive. I used to contract for Mozilla Foundation (not as a developer, but as a coordinator for a digital skills social program). I have sent patches to different Mozilla apps and know a lot of people inside. I am in a very good position to build this as I know the APIs well (for add-ons) and know who I can contact if I need help from Mozilla, I also know that I can reach out for all you amazing people in case (aka when) I need help with scuttlebutt APIs.

I am building this anyway but without the grant, I can't devote the necessary time to do this in the best way possible and also in a short time. The grant would allow me to focus.

User has chosen not to be hosted publicly
@SoapDog %faW2ewg7HRRTmkoXxPqpjImYPndgjMeZQ/GCi+j8Tu8=.sha256

thanks a lot @noffle for adding it there.

@Dominic %49cyzEqxplYXAE2HQa+4S1HmBU/SoVmhhtJJyI6GseI=.sha256

I like this proposal. People often complain about electron (and the people who complain are usually the sort most likely to make pull requests, so I like to keep them happy)

It also seems like an opportunity to incept secure-scuttlebutt into mozilla! Especially since you are campaigning to get support for ssb:// (etc) and other dex protocols

@SoapDog %XTHPkz+5qge+MEfZ3sJok2i45Nmvo5H/Xwe4zCh4a+A=.sha256

The patch to add ssb: landed on #firefox nightly as seen on this message here. This should help this proposal.

@SoapDog %2CNEJmRxDX/LtPPEuYTb6NIqAm7iE+KVenkqJERIqvw=.sha256

There is still a long way ahead for patchfox but things are starting to get into shape. Here on the shot below you can see the mini help sidebar that is automatically displayed after the extension is installed. There is also a tiny hermie button on the top right that has a popup for the client features.

sidebarAction.setTitle() - Mozilla _ MDN - Firefox Nightly 2018-02-09 17.54.01.png

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
@SoapDog %UGo2JZNgpc/MkhX3GenuXjO58C2h0UzZfSzYRfvH00A=.sha256

thanks a lot @vageli :heart_eyes_cat:

@SoapDog %AA3JZRROemS37fKj8LU6wlw10CyYZ773BlnJgLxHu74=.sha256

Friends,

it is getting better!!!!

ezgif.com-resize.gif

I got NodeJS to work as a host app for Native Messaging. So I can now load stuff!!! Right now, the host app is starting an HTTP server, I may in the future switch that to use extension.getURL() and point it to an internal HTML but for now, this is already useful.

For the moment, I am starting from #minbay because it was the easiest client to remove electron and also to pass through browserify. I plan to bring it closer to #patchbay though, there are many things that I need to replace inside the client. The use of patchapp-threads makes it hard to add your own stuff to the interface but now that nodejs is finally not crashing on me, I can focus on working on the interface side.

User has not chosen to be hosted publicly
User has not chosen to be hosted publicly
@mix %Ti2yDqpHgGtM1pAumw9Tuv5rV2bUetD5Ymt0EbsGHq4=.sha256

wow wow wow xxx

@SoapDog %b7W5qh7WaE+6b/DiSmGeU3cTjZ9MJ+Wt0O+rbam+1vU=.sha256

@substack I have added my current work-in-progress stuff to the patchfox repo on my github. The files that are interesting for your case with #patchfoo are:

  • manifest.json which asks for native messaging permission.
  • background.js which establishes a connection to a native host app built with NodeJS. This file is run when the application is installed or the browser is launched afterwards.
  • host-app.js is the native app built with NodeJS, it starts Scuttlebutt using a childprocess from a file called server.js because native messaging uses the standard i/o and the amount of data coming out of scuttlebutt was making the browser confused and it would disconnect from the background app.

There are some gotchas regarding manifest and registry entries (in case you're on windows), the scripts folders contains some scripts to check the configuration files and set them up if needed on both UNIX-like environments and on Windows 10.

User has not chosen to be hosted publicly
Join Scuttlebutt now