The Future of the Web - Cold Front conference 2016

120
The Future of the Web @robertnyman

Transcript of The Future of the Web - Cold Front conference 2016

Page 1: The Future of the Web - Cold Front conference 2016

The Future of the Web

@robertnyman

Page 2: The Future of the Web - Cold Front conference 2016

I'm from Sweden

Credit: https://www.flickr.com/photos/stephenbove/184201987

Page 3: The Future of the Web - Cold Front conference 2016

I'm from Sweden

Credit: https://www.pinterest.com/pin/313352086545358825/

Page 4: The Future of the Web - Cold Front conference 2016

Web lifeWeb developer since

1999

Mozilla community from 2009

Mozilla employee 2011-2014

Page 5: The Future of the Web - Cold Front conference 2016
Page 6: The Future of the Web - Cold Front conference 2016
Page 8: The Future of the Web - Cold Front conference 2016
Page 9: The Future of the Web - Cold Front conference 2016

The web as of today

Page 10: The Future of the Web - Cold Front conference 2016

Web declared dead in 2010

Page 11: The Future of the Web - Cold Front conference 2016

Web declared dead in 2010

Page 12: The Future of the Web - Cold Front conference 2016

Web very much alive in 2016!

Page 13: The Future of the Web - Cold Front conference 2016

Nov 2015, 800 Million users

Page 14: The Future of the Web - Cold Front conference 2016

May 2016, 1 Billion users

Page 15: The Future of the Web - Cold Front conference 2016

The web is dead?

Page 16: The Future of the Web - Cold Front conference 2016

Apps

Credit: http://imgs.xkcd.com/comics/app.png

Page 17: The Future of the Web - Cold Front conference 2016

Apps

Page 18: The Future of the Web - Cold Front conference 2016

Web is all browsers

Page 19: The Future of the Web - Cold Front conference 2016

The web & Chrome

Page 20: The Future of the Web - Cold Front conference 2016

Web as of today => Progressive Web Apps

Page 21: The Future of the Web - Cold Front conference 2016

Instant Loading

Service Workers

Both for offline and poornetwork situations

Page 22: The Future of the Web - Cold Front conference 2016

Add to Home Screen

Shortcut on Homescreen

Install banners

Page 23: The Future of the Web - Cold Front conference 2016

Push Notifications

Re-engagement

Relevant, timely, and contextual notifications

Page 24: The Future of the Web - Cold Front conference 2016

Fast

Smooth animations, scrolling and navigation

Page 25: The Future of the Web - Cold Front conference 2016

Secure

HTTPS

Page 26: The Future of the Web - Cold Front conference 2016

Responsive

Adapting content to any screen size

Page 27: The Future of the Web - Cold Front conference 2016

Service workers allow for offline caching

and instant loading.

Smooth animations, scrolling and

navigations keep the experience silky

smooth.

Push notifications and add to

homescreen help users re-engage.

HTTPS secures the connection between you

and your users.

Reliable Fast Engaging Secure

Progressive Web Apps, today

Page 28: The Future of the Web - Cold Front conference 2016

We've come a long way

Page 29: The Future of the Web - Cold Front conference 2016

The web is almighty powerful

Page 30: The Future of the Web - Cold Front conference 2016

It's just the beginning

What we do now is the beginning

What's needed to play

Table stakes

Page 31: The Future of the Web - Cold Front conference 2016

What about the future?

Credit: https://www.flickr.com/photos/mssarakelly/9422242223

Page 32: The Future of the Web - Cold Front conference 2016
Page 33: The Future of the Web - Cold Front conference 2016

Things we'll talk about todayKnowing who the user is

Credentials Management

Paying for things on the web

Connecting with hardware

Physical Web

WebVR

Page 34: The Future of the Web - Cold Front conference 2016

Knowing who the user is

Credit: https://commons.wikimedia.org/wiki/File:Steal_password.jpg

Page 35: The Future of the Web - Cold Front conference 2016

Title Text

Password

Forgot password?

Login

LOGIN

Don’t have an account? Sign up!

Did I use that?

$%&§”%$?!

Hm?

Most likely!

Yes, but which one?Email address

Page 36: The Future of the Web - Cold Front conference 2016

It's hard to type on a mobile device

Page 37: The Future of the Web - Cold Front conference 2016

Most popular password in 2015

1 2 3 4 5 6

Page 38: The Future of the Web - Cold Front conference 2016

2nd most popular password in 2015

password

Page 39: The Future of the Web - Cold Front conference 2016

Smart Lock for passwords

Page 40: The Future of the Web - Cold Front conference 2016

sign-ins assisted per month

8 billion

Page 41: The Future of the Web - Cold Front conference 2016

Sign Up Form

<form id="signup" action="signup.php" method="post"> <input name="display-name" type="text"> <input name="phone" type="text"> <input name="email" type="text"> <input name="password" type="password"> <input type="submit" value="Sign Up!"> </form>

Friendly name? Identifier? Idunno?

Page 42: The Future of the Web - Cold Front conference 2016

Sign Up Form

<form id="signup" action="signup.php" method="post"> <input name="display-name" type="text" autocomplete="name"> <input name="phone" type="text" autocomplete="home tel"> <input name="email" type="text" autocomplete="username"> <input name="password" type="password"> <input type="submit" value="Sign Up!"> </form>

Aha!

Page 43: The Future of the Web - Cold Front conference 2016

Sign In Form

<form id="login" action="login.php" method="post"> <input name="username" type="text" autocomplete="username"> <input name="password" type="password" autocomplete="current-password"> <input type="submit" value="Sign In!"> </form>

Page 44: The Future of the Web - Cold Front conference 2016

Sign Up Form

<form id="signup" action="signup.php" method="post"> <input name="display-name" type="text" autocomplete="name"> <input name="phone" type="text" autocomplete="home tel"> <input name="email" type="text" autocomplete="username"> <input name="password" type="password" autocomplete="new-password"> <input type="submit" value="Sign Up!"> </form>

Page 45: The Future of the Web - Cold Front conference 2016

password

Page 46: The Future of the Web - Cold Front conference 2016

auto-generated password

7nUvA8jyowEk44

Page 47: The Future of the Web - Cold Front conference 2016

the Credentials Management API

Credit: https://commons.wikimedia.org/wiki/File:Michael_de_la_Force_Leaders_Magazine_Press_Credentials_2013.jpg

Page 48: The Future of the Web - Cold Front conference 2016

Automatic Sign-in

Page 49: The Future of the Web - Cold Front conference 2016

navigator.credentials.get({ "password": true, "unmediated": true }).then(c => { if (!c) return; // Hooray, we have a credential! signInToYourApplication(c); });

Page 50: The Future of the Web - Cold Front conference 2016

Automatic Sign-in

Chrome will offer automatic sign-in if and only if:

✓Automatic sign-in is enabled

✓Only one credential is saved for the site

Page 51: The Future of the Web - Cold Front conference 2016

Automatic Sign-in

✓navigator.credentials is restricted to secure contexts

✓Passwords are not directly exposed to JavaScript

✓fetch() will only submit credentials to same-site endpoint

Page 52: The Future of the Web - Cold Front conference 2016

function signInToYourApplication(c) { fetch("/signin", { "method": "POST", "credentials": c }).then(r => { if (r.status == 200) renderSignedInExperience(r); else renderUsefulErrorMessage(); });}

Page 53: The Future of the Web - Cold Front conference 2016

One-tap Sign-in

Page 54: The Future of the Web - Cold Front conference 2016

navigator.credentials.get({ "password": true }).then(c => { if (!c) return; // Hooray, we have a credential! signInToYourApplication(c); });

Page 55: The Future of the Web - Cold Front conference 2016

Storing credentials

Page 56: The Future of the Web - Cold Front conference 2016

var f = document.querySelector("#form");var c = new PasswordCredential(f);navigator.credentials.store(c) .then(_ => { // ... });

Page 57: The Future of the Web - Cold Front conference 2016

Federated log-ins

Page 58: The Future of the Web - Cold Front conference 2016

var c = new FederatedCredential({ "id": "username", "provider": "https://accounts.google.com"});navigator.credentials.store(c) .then(_ => { // ... });

Page 59: The Future of the Web - Cold Front conference 2016

navigator.credentials .requireUserMediation() .then(_ => { // Sign the user out. });

Logging out

Page 60: The Future of the Web - Cold Front conference 2016
Page 61: The Future of the Web - Cold Front conference 2016

Paying for things on the web

Credit: http://www.publicdomainpictures.net/view-image.php?image=149197

Page 62: The Future of the Web - Cold Front conference 2016

66%of purchases on mobile are on web

Page 63: The Future of the Web - Cold Front conference 2016
Page 64: The Future of the Web - Cold Front conference 2016
Page 65: The Future of the Web - Cold Front conference 2016

66%Fewer conversions on mobile websites vs. desktop

Page 66: The Future of the Web - Cold Front conference 2016

Have you ever abandoned a purchase

because of the checkout form?

Page 67: The Future of the Web - Cold Front conference 2016

Manual Tedious Slow N-taps

Checkout forms today

Page 68: The Future of the Web - Cold Front conference 2016

Autofill Fill web forms with a single click

Page 69: The Future of the Web - Cold Front conference 2016

Card and address saved to Chrome

Automatic form detection

95% ACCURACY

Form filled automatically

How Autofill works

XYZ

Page 70: The Future of the Web - Cold Front conference 2016

25 Increase in conversion rate from Autofill

%

Page 71: The Future of the Web - Cold Front conference 2016

Manual Tedious Slow N-taps

Checkout with Autofill

Automatic Simple

Page 72: The Future of the Web - Cold Front conference 2016

Imagine a world without forms...

Page 73: The Future of the Web - Cold Front conference 2016

PaymentRequest A W3C API to eliminate checkout forms for users and standardize payment collection for sites

Page 74: The Future of the Web - Cold Front conference 2016

Designing PaymentRequest at W3C

Cross-browser

Page 75: The Future of the Web - Cold Front conference 2016

Designing PaymentRequest at W3C

Cross-browser Open ecosystemCross-platform

Page 76: The Future of the Web - Cold Front conference 2016

N-tapsSlowManual Tedious

Checkout with PaymentRequest

Automatic Simple Fast 1-tap

Page 77: The Future of the Web - Cold Front conference 2016

new PaymentRequest( [“visa“, “mastercard“, “amex“, “discover“], { items: [ { id: "basket", label: "Sub-total", amount: { currencyCode: "USD", value: "55.00" }, // $55.00 }, { id: "tax", label: "Sales Tax", amount: { currencyCode: "USD", value: "5.00" }, // $5.00 }, { id: "total", label: "Total excluding shipping", amount: { currencyCode: "USD", value: "60.00" }, // $60.00 } ] }, { requestShipping: true } ).show().then(response => { /* process payment */ }).catch(error => { /* handle */ });

Page 78: The Future of the Web - Cold Front conference 2016

new PaymentRequest( [“visa“, “mastercard“, “amex“, “discover“], { items: [ { id: "basket", label: "Sub-total", amount: { currencyCode: "USD", value: "55.00" }, // $55.00 }, { id: "tax", label: "Sales Tax", amount: { currencyCode: "USD", value: "5.00" }, // $5.00 }, { id: "total", label: "Total excluding shipping", amount: { currencyCode: "USD", value: "60.00" }, // $60.00 } ] }, { requestShipping: true } ).show().then(response => { /* process payment */ }).catch(error => { /* handle */ });

Page 80: The Future of the Web - Cold Front conference 2016
Page 81: The Future of the Web - Cold Front conference 2016

var request = new PaymentRequest( [“visa”, ..., “https://android.com/pay”], // add Android Pay as supported { items: [...] }, { requestShipping: true }, { // add Android Pay application specific parameters "https://android.com/pay": { "gateway": "stripe", "stripe:publishableKey": "put_your_stripe_publishable_key_here", "stripe:version": "2015-10-16 (latest)" } } );

Page 82: The Future of the Web - Cold Front conference 2016

PaymentRequest with Autofill cards in

Chrome Dev Android

PaymentRequest available in Chrome

Beta on mobile; Android Pay

Support for all platforms & 3rd party

payment apps

May 2016 Aug 2016 Early 2017

When can I use PaymentRequest?

Page 83: The Future of the Web - Cold Front conference 2016
Page 84: The Future of the Web - Cold Front conference 2016

Connecting with hardware

Credit: Kenneth Rohde Christiansen

Page 85: The Future of the Web - Cold Front conference 2016
Page 86: The Future of the Web - Cold Front conference 2016

The evolution of transfer rates

Wi-Fi (Mbps)

802.11: 2 802.11b: 11 802.11g: 54 802.11n: 135

Ethernet (Mbps)

802.3i: 10 802.3u: 100 802.3ab: 1000 802.3an: 10000

Bluetooth (Mbps)

1.1: 1 2.0: 3 3.0: 54 4.0: 0.3

Page 87: The Future of the Web - Cold Front conference 2016
Page 88: The Future of the Web - Cold Front conference 2016
Page 89: The Future of the Web - Cold Front conference 2016
Page 90: The Future of the Web - Cold Front conference 2016
Page 91: The Future of the Web - Cold Front conference 2016

Demo time!https://webbluetoothcg.github.io/demos/playbulb-candle/

Page 92: The Future of the Web - Cold Front conference 2016

Basic BLE terms to know...

“Central” device (my phone) “Peripheral” device (candle) GATT (Generic ATTribute profile)

Page 93: The Future of the Web - Cold Front conference 2016

var options = { filters: [{ services: [’battery_service’] }] };

navigator.bluetooth.requestDevice(options).then(device => { console.log(device.name); ...}).catch(error => { console.log(error); });

Page 94: The Future of the Web - Cold Front conference 2016

var options = { filters: [{ services: [’battery_service’] }] };

navigator.bluetooth.requestDevice(options).then(device => device.gatt.connect()).then(server => { ... }).catch(error => { console.log(error); });

Page 95: The Future of the Web - Cold Front conference 2016

var options = { filters: [{ services: [’battery_service'] }] };

navigator.bluetooth.requestDevice(options).then(device => device.gatt.connect()).then(server => server.getPrimaryService(’battery_service’)).then(service => service.getCharacteristic(’battery_level’)).then(characteristic => characteristic.readValue()).then(value => { console.log(’Battery percentage is ’ + value.getUint8(0));}).catch(error => { console.log(error); });

Page 96: The Future of the Web - Cold Front conference 2016

var options = { filters: [{ services: [CANDLE_SERVICE_UUID] }], optionalServices: ['battery_service'] };navigator.bluetooth.requestDevice(options).then(device => device.gatt.connect()).then(server => server.getPrimaryService(CANDLE_SERVICE_UUID)).then(service => service.getCharacteristic(CANDLE_COLOR_UUID)).then(characteristic => { let data = [0x00, r, g, b, 0x05, 0x00, 0x01, 0x00]; return characteristic.writeValue(new Uint8Array(data));}).catch(error => { console.log(error); });

Page 97: The Future of the Web - Cold Front conference 2016

Android Developer Options

Page 98: The Future of the Web - Cold Front conference 2016

var options = { filters: [{ services: [CANDLE_SERVICE_UUID] }] };

navigator.bluetooth.requestDevice(options).then(device => device.gatt.connect()).then(server => server.getPrimaryService(CANDLE_SERVICE_UUID)).then(service => service.getCharacteristic(CANDLE_BLOW_NOTIFICATIONS_UUID)).then(characteristic => { characteristic.addEventListener(’characteristicvaluechanged’, blow); return characteristic.startNotifications(); }).catch(error => { console.log(error); });

function blow(event) { console.log(event.target.value); }

Page 99: The Future of the Web - Cold Front conference 2016

WebNFC

Page 100: The Future of the Web - Cold Front conference 2016

navigator.nfc.watch((message) => { for (let record of message.data) { let article =/[aeio]/.test(record.data.title) ? "an" : "a"; console.log( `$(record.data.name) is $(article) $(record.data.title)` ); }}, { url: document.baseURI, recordType: "json" });

Page 101: The Future of the Web - Cold Front conference 2016

Your local hero

Page 102: The Future of the Web - Cold Front conference 2016

Generic Sensors

Page 103: The Future of the Web - Cold Front conference 2016

let sensor = new DirectTirePressureSensor({ position: "rear", side: "left" });sensor.onchange = event => console.log(event.reading.pressure);

Page 104: The Future of the Web - Cold Front conference 2016

try { // No need to feature detect thanks to try..catch block. let sensor = new GeolocationSensor({}); sensor.start(); sensor.onerror = error => gracefullyDegrade(error); sensor.onchange = event => updatePosition(event.reading.coords);} catch(error) { gracefullyDegrade(error);}

Page 105: The Future of the Web - Cold Front conference 2016

The Physical Web

http://www.physical-web.org

Credit: https://en.wikipedia.org/wiki/Spider_web

Page 106: The Future of the Web - Cold Front conference 2016
Page 107: The Future of the Web - Cold Front conference 2016

/* Awesomeness to come */

var referringDevice = navigator.bluetooth.referringDevice;

if (referringDevice) { referringDevice.gatt.connect() .then(server => { ... }) .catch(error => { console.log(error); });}

Page 108: The Future of the Web - Cold Front conference 2016
Page 109: The Future of the Web - Cold Front conference 2016

Virtual Reality, WebVR

Page 110: The Future of the Web - Cold Front conference 2016

WebVR API 1.0 progress!

Landing in browsers:

Firefox Nightly 2 weeks ago Chrome later this year

Page 111: The Future of the Web - Cold Front conference 2016

Daydream

Page 112: The Future of the Web - Cold Front conference 2016

Daydream

Page 115: The Future of the Web - Cold Front conference 2016

Oculus CEO & co-founder

Page 116: The Future of the Web - Cold Front conference 2016

Tell us what you needReport bug https://crbug.com

Feature statushttps://chromestatus.com

Slackhttps://goo.gl/jCWx5m

Videos https://www.youtube.com/user/ChromeDevelopers

@ChromiumDev

Page 117: The Future of the Web - Cold Front conference 2016

Credit: https://github.com/alrra/browser-logos

Page 118: The Future of the Web - Cold Front conference 2016

Working together on making the web better Credit: https://twitter.com/simonnricketts/status/699198327338987520

Page 119: The Future of the Web - Cold Front conference 2016

The Future of the Web