Web Browsers:
Om nom nom

By Steve Klabnik

Slides: http://steveklabnik.github.io/browsers_eat_the_world/

We have failed
non-programmers

"The thing I think historians will miss is that a web browser represents the first time we can download arbitrary
executable code and not worry about screwing things up." - @tomdale

Web Standards Now

How it "works"

  • Browser vendor proposes feature.
  • W3C specification.
  • Other browser vendors implement the feature.
  • Someone implements a JS wrapper on top of feature.

Cons

  • Vendors don't build sites.
  • Takes forever.
  • No web dev feedback.
  • Spotty support.

Web Standards Tomorrow?

How it should work

  • Build new features in JS.
  • W3C specification.
  • Implement natively in browsers.

Pros

  • Devs do build sites.
  • Speed not limited by vendors.
  • Polyfill on day one.

Cons

Browsers aren't extensible.

Extending Browsers

Example: CSP

Content-Security-Policy: default-src 'self' ajax.googleapis.com

CSP in JS

var origin = window.location.origin;
 
page.addEventListener('fetch', function(e) {
  var url = e.request.url;
  if (origin !== url.origin) {
    // block the network request
    e.preventDefault();
  }
 
  // otherwise, allow the network request through
});

jQuery polyfill

"Apps"

Bookmarking a site == installing an 'app'

So... Rails?

  • Basically APIs only.
  • Use Rails-API.
  • Use JSON-API.
  • Use Ember.
  • Admit reality.

Web Browsers: Om nom nom

<3 - @steveklabnik

http://extensiblewebmanifesto.org