Making the Browser a True User Agent
How to hack on this deck: https://hackmd.io/slide-example?both
Example slides all at end of this deck
Run presentation
Themes
black (default), white, league, sky, beige, simple, serif, blood, night, moon, solarized
Irakli Gozalishvili
Andre Garzia
Dietrich Ayala
@Gozala Mozilla
@soapdog LiveCode, Mozilla Tech Speaker
@autonome Protocol Labs
background image: browser icons
The web is really big - ~4.5 billion pages
~1.5 billion websites
Incredible success - largest public collection of human knowledge
And for 30 years browsers have been a client
we call this client the user-agent
RFC 1945 - Hypertext Transfer Protocol – HTTP/1.0
what is a user agent?
it fetched web pages from a server
this was fine for a while
but problems crept up along the way
power imbalance: the server has all the power
client wants the old version of a page? too bad, we redesigned!
client tries to access a business critical service? too bad, Twitter bought it and shut it down
Two devices in the same room communicate through server.
Data surrendered to corporate silo & can only be accessed on their terms & via their tools .
turns out this "user agent" isn't. it's a dumb vehicle for what the authority's agenda
does it represent me?
User has no say in which data browser surrenders to which servers .
website goes offline
company goes out of business or bought
Tracking
Censorship
don't have full working source
Image credits: Thai government, Twitter, Pixabay, me
background image: main browser icons
Which one of these implements ipfs? dat? blockchain natively?
While they are pushing the web forward in some ways
they are also gatekeepers
What if?
What if we had web browsers that were reflection of our values
What are the trade-offs we would make if we could
Eg, we could all be collaborating right now even if this wifi not connected to the internet
Andrew from Textile mentioned yesterday about how all apps and services start to normalize to the lowest common denominator
Browsers are so important - the multi-app, the mega-app …
the user agent
it should be a reflection of you!
What if your web browser truly reflected your values - advocating for you, and filtering for you, running as first-class nodes in distributed networks or even light clients? What if you could build your own dweb browser, or add dweb capabilities to an existing browser? Or what’s the closest we can get to a dweb experience in today’s browsers without any core changes at all? We’ll show examples of each of these approaches to making a browser truly an agent that represents you, and discuss the benefits and challenges of each.
sticky: "what if?"
Your User Agent, Your Values
sticky: two values
Ask participants to write the values they care the about the most on the stickies and stick them to the wall.
Dweb browser == Utopia?
So if we do this, our job is done?
The web is perfect now, forever?
So how do we do this?
Browser Extensions (libdweb) 💻
Localhost bridges 💻
Proxy workers 💻📱
Electron 💻
Mozilla Reference Browser (+libdweb?) 📱
React Native 📱
Textile 📱
eg, SSB and Patchwork has values and trade-offs (eg: works like real life relationships, own your own data)
Browser Extensions 🚀
Augment existing web 🕶
Make a new protocol ipfs://
🔩
Turn it into a local server 📻
Turn browser into P2P node (libdweb) 🛰
" Unlimited storage " 💾
Offline first ✈️
Patchfox
Offline-first secure decentralized gossip platform as a Firefox Add-on .
A local social network meets web browser.
Many apps, a single database on your machine.
Patchfox as a bridge between SSB and Web.
Values:
Based on human relationships, meaningful connections.
Your friends are the datacenter.
No cloud, no company, no ads, no tracking.
Like an hermit crab, you carry your house with you.
Your data is secure, verifiable and private.
Trade-offs:
Lots of friction to onboard new users.
Hosting friends data takes lot of disk space.
Our stack is a bit too complex and not web friendly.
Needs a locally running app.
No cross-device identity.
Constraints:
The Web Platform really wants to talk to web servers.
Web Browsers don't want to be web servers.
Lack of required networking primitives.
IndexedDB 😭😭😭.
(TODO: Andre)
What were the limitations of the browsers / web platform that had to be overcome with other tools.
Solution:
Run a native app or daemon and connect to it over WebSockets .
Provide the UI/UX in the browser.
Use Native Messaging to start local node.
Custom Protocols to provide ssb://
features
(TODO: Andre)
What approach was used to overcome those limitations / fulfill values.
Patchfox DEMO
(TODO: Andre)
Show it in action.
Description: Using browser extensions for IPC with local nodes.
Trainer: Soapdog
Intro Slides
*
Demo:
Show patchfox running and going from SSB to IPFS and maybe DAT.
Attendee should have:
Firefox Dev Edition or Nightly (unless I can actually releas on AMO in time)
IPFS Desktop
Workshop should provide:
Add-on template. I might just create a couple which they can tweak.
Presenter should have:
Faith in the network Gods.
Maybe a Pi running a little pub.
Tradeoffs:
Still needed:
Need to figure out before hand if an add-on can inject into another add-on, which could lead to some awesome demos.
Lunet
local-first applications on IPFS
Description: Progressive peer-to-peer applications in mainstream browsers through existing web APIs and seamless enhancment through companion app.
Trainer: Irakli
Intro Slides
*
Demo:
Show peerdium example.
Maybe @jimpick's collaborative notebook ?
Attendee should have:
Workshop should provide:
App Template (TODO: Help wellcomed)
Presenter should have:
Local verison of lunet.link in case internet is broken.
Tradeoffs
Requires internet to first time
Values:
Works offline (after first load)
Users own data & choose who to share with
Data encrypted by default
No tracking
Additional Goals:
Unified user data library
Works in mainstream browsers
No install requirements
Apps = HTML+JS that read/write data via REST
Tradeoffs:
Apps are constrained
Data interop
Availability across devices
can't embed third party content like images, scripts.
built-in encryption introduces separate data format not supported by existing software.
Availability across devices requires sync that is more complicated than centralized system.
Constraints:
No install =>
Gateway
Domain Name resolution =>
Gateway
Cross device share =>
Install OR Gateway
Browser in your Browser (UX challenge)
Local collaboration =>
Install
Browser might purge data
Localhost Bridge
Going beyond web capabilities via companion application.
(Flash of P2P)
Description: Using companion application to access p2p capabilities in the the mainstream browsers.
Trainer: One of us
Intro slides:
*
Demo:
Lunet is is non-trivial demo using IPFS Desktop.
Textile Desktop .
Maybe trivial example leveraging IPFS Desktop.
Attendee should have:
Workshop should provide:
Goals:
Works in mainstream browsers
Overcome web platform limitations
UDP Socket
FileSystem
OS Integration
Works Offline
Solution:
Native App exposing HTTP / WebSocket API
Access-Control-Allow-Origin: https://myapp.com
Trade-offs:
High upfront cost (Requires install)
Not viable model for mobile
UX challenges
Libdweb
Description: Turning Firefox into full-fledged node via experimental extension APIs.
Trainer: Irakli
Demo:
Show dat-webext example.
Show IPFS extension example (where can I get it ?)
Attendee should have:
Firefox Nightly
web-ext tool installed.
Workshop should provide:
Presenter should have:
dat-webext
ipfs-companion with libdweb
dat-webext mobile
Electron
Building dweb-capable desktop browser-based applications.
(TODO: Dietrich)
Describe what it is
Demo:
Show IPFS Electron example
Show Beaker browser
Attendee should have:
node.js and npm
npm install electron -g
Workshop should provide:
repo: autonome/electron-ipfs
Presenter should have:
Beaker browser and a dat URL to demo
IPFS-electron and a CID to demo
Values:
you can publish!
you can share (republish)!
you own your own data!
you can fetch from swarms!
you can do whatever you want !!!
more capabilities than regular web
non-traditional use-cases
Trade-offs:
have to download and install
no cross browser compatibility
unclear security/privacy risks
you can do whatever you want !!!
Solution:
Electron
Whole browser or embedded web view
Bundle the dweb tool of your choice!
(TODO: Dietrich)
What approach was used to overcome those limitations / fulfill values.
Beaker showing me showing Cliqz
Mozilla Reference Browser
Description: Building mobile IPFS applications with react-native-webview.
Trainer: Dietrich
Demo:
Show dat mobile
Show Manyverse
Show Puma
Attendee should have:
*
Workshop should provide:
Presenter should have:
TODO
android web components
for browsers or browser-like applications
which combined with webextensions
to make Cliqz DAT browser
one line of code to install!
Breakout!
Build a web-view powered app: This group gathers both those interested in react-native and electron.
Work with the browser today: This group gathers those that want to augment browsers with tech that works today. It groups lunet (web apps) and patchfox (add-ons)
Towards a future browser: This group changes the browser and appeals to those interested in libdweb.
After an initial exposition, we'll break out into groups per interest. Each group has a facilitator to help people around the subject matter.
Closure
We reserve the final minutes of the workshop for a "round the circle" feedback session where each participant tells the other what exciting thing they saw during the workshop and what are their takeaways or plans for the future.
Request ./index.html
ServiceWorker forwards request to iframe parent
Parent resolves ./index.html -> /ipfs/QmYj...BPZro/index.html
Parent reads content via
Parent post content to ServiceWorker
ServiceWorker responds with content.
User Library
Each app gets own document space (+ REST API).
Listing Documents
await fetch ("/data/" , {method :"LIST" })
Initially will be empty
Each app has own namespace
Need to open to read / write
Open Document
await fetch ("/data/Demo.space" , {method :"OPEN" })
Create Document
await fetch ("/data/Demo.space?create" , {method :"OPEN" })
Documents are encrypted
Read Document Content
const content = await fetch ("/data/Demo.space/content.json" )
const data = await file.json ()
Documents content is seamlessly decrypted
Write Document Content
await fetch ("/data/Demo.space/content.json" , {
body : JSON .stringify (data),
method : "PUT"
})
Documents content seamlessly encrypted
Resume presentation
Making the Browser a True User Agent How to hack on this deck: https://hackmd.io/slide-example?both Example slides all at end of this deck Run presentation To view as deck: https://hackmd.io/@dietrich/rkrZEKFRV#/ Or: click the share button on top-right, select "Slides" view and click the "Preview" button Themes black (default), white, league, sky, beige, simple, serif, blood, night, moon, solarized
{"metaMigratedAt":"2023-06-14T22:10:45.446Z","metaMigratedFrom":"YAML","title":"Making the Browser a True User Agent","breaks":true,"description":"Learn how to create web applications, modify web browsers, and even create your own web browser which truly represent you and your values.","slideOptions":"{\"theme\":\"white\"}","contributors":"[{\"id\":\"fff58d5d-df29-4dd3-93ef-42fd0194a26f\",\"add\":15008,\"del\":16576},{\"id\":\"68b4b616-daaa-4bc2-9790-7a3e08d607fa\",\"add\":1312,\"del\":381},{\"id\":\"d6197ec8-a266-4592-922e-527b6553bf99\",\"add\":24452,\"del\":7267}]"}