Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Coming up in Chrome: Project Fugu and its new W...

Coming up in Chrome: Project Fugu and its new Web APIs

Project Fugu is a public, cross-company collaboration to close the
capabilities gap with native applications by specifying and shipping new
APIs, ranging from raw clipboard access to Web Serial to WebNFC. This
talk covers Fugu in more detail, shows how easy and important it is for
everyone to contribute (an API is nothing without users!) and showcases
a few new APIs the Web Technologies team at Intel has been involved in.

Raphael Cubo da Costa gave this talk at the WebCore meetup in Amsterdam on September 24th, 2019

Avatar for WebCore Meetup

WebCore Meetup

September 24, 2019
Tweet

More Decks by WebCore Meetup

Other Decks in Programming

Transcript

  1. Coming up in Chrome: Project Fugu and its APIs Raphael

    Kubo da Costa Software Engineer WebCore meetup, Sept. 2019
  2. Olá/Moikka/Hallo! • • Software Engineer at Intel’s Web Technologies Team

    since 2012 • Worked on web engines and runtimes since 2010 • Specs (W3C, WHATWG) and C++ implementation work • … not great at actual web development …
  3. Audio & Video Capture Advanced Camera Controls Recording Media Real-Time

    Communication USB Credentials Payments Network Type & Speed Online State Battery Status Local Notifications Push Messages Home Screen Installation Foreground Detection Permissions File Reading Touch Settings Speech Recognition Pointing Device Adaptation Offline Mode Background Sync Geolocation Device Position Device Motion Virtual & Augmented Reality Fullscreen Screen Orientation & Lock Presentation Features Vibration Device Memory Bluetooth Real-Time Communication Touch Gestures Storage Quotas
  4. Enable web apps to do anything native apps can, by

    exposing the capabilities of native platforms to the web platform, while maintaining user security, privacy, trust, and other core tenets of the web. bit.ly/powerful-apis
  5. The process Write explainer Solicit feedback and iterate Formalize spec

    and look for public support Origin Trial >> Ship It Identify need and use-cases goo.gle/fugu-process
  6. The process Write explainer Solicit feedback and iterate Formalize spec

    and look for public support Origin Trial >> Ship It Identify need and use-cases goo.gle/fugu-process
  7. The process Write explainer Solicit feedback and iterate Formalize spec

    and look for public support Origin Trial >> Ship It Identify need and use-cases goo.gle/fugu-process
  8. The process Write explainer Solicit feedback and iterate Formalize spec

    and look for public support Origin Trial >> Ship It Identify need and use-cases goo.gle/fugu-process
  9. The process Write explainer Solicit feedback and iterate Formalize spec

    and look for public support Origin Trial >> Ship It Identify need and use-cases goo.gle/fugu-process
  10. A separate slide for Origin Trials • Allows us Chrome

    engineers to try features out in the real world • Users do not need to change anything in their browser • Features are available on a per-origin basis (add a token in a <meta> tag or send it an HTTP header) • Limited reach (max 0.5% of all Chrome page loads) • Not exclusive to Fugu features • https://developers.chrome.com/origintrials
  11. Generic Sensors • Set of low-level APIs that expose sensor

    functionality in a safe and consistent way • Configurable frequency, new event types • Easy to add new sensor types const sensor = new Accelerometer({ frequency: 15 }); sensor.start(); sensor.onreading = () => { console.log("Acceleration along X-axis: " + sensor.x); console.log("Acceleration along Y-axis: " + sensor.y); console.log("Acceleration along Z-axis: " + sensor.z); } sensor.onerror = event => console.log(event.error.name, event.error.message);
  12. Generic Sensors • Accelerometer, Gyroscope, LinearAccelerationSensor, AbsoluteOrientationSensor, RelativeOrientationSensor: shipping •

    AmbientLightSensor: Q4 2019? ◦ Currently behind #enable-generic-sensor-extra-classes in chrome://flags https://sensor-compass.appspot.com/ https://intel.github.io/generic-sensor-demos/ https://w3c.github.io/sensors/
  13. WebNFC • Allows web pages to use NFC to communicate

    wirelessly when at close proximity. • Supports reading and writing NFC tags via NFC Data Exchange Format (NDEF) • Android-only (for now) const reader = new NFCReader(); reader.onreading = event => { for (let record of event.message.records) { if (record.recordType === "json") { console.log(`JSON: ${record.toJSON().myProperty}`); } } }; const ctr = new AbortController; reader.scan({ signal: ctr.signal });
  14. WebNFC • Spec still in flux, implementation gearing towards an

    Origin Trial • Origin Trial: Q4 2019? ◦ Currently behind #enable-webnfc in chrome://flags https://kenchris.github.io/webnfc-groceries/ https://w3c.github.io/web-nfc/
  15. (Screen) Wake Lock • Screen wake locks prevent the screen

    from turning off • System wake locks prevent the device from entering standby mode • We are focusing on screen wake locks at the moment function tryKeepScreenAlive(minutes) { const controller = new AbortController(); const signal = controller.signal; WakeLock.request("screen", { signal }); setTimeout(() => controller.abort(), minutes * 60 * 1000); } tryKeepScreenAlive(10);
  16. (Screen) Wake Lock • Spec was rewritten in early 2019,

    implementation and spec are pretty stable now • Origin Trial: Q4 2019? ◦ Currently behind #enable-experimental-web-platform-features in chrome://flags https://tomayac.github.io/wikipedia-screensaver/dist/ https://w3c.github.io/wake-lock/
  17. Media Capture extensions • Enables capturing media from the video

    feed • New camera controls (ISO, contrast, brightness etc) • Pan/tilt/zoom in compatible cameras PDF sidenote For proper animations, see https://riju.github.io/WebCamera
  18. Media Capture extensions • Already shipping • Pan/tilt/zoom is still

    behind --enable-experimental-web-platform-features flag in chrome://flags https://riju.github.io/WebCamera/ https://w3c.github.io/mediacapture-image/
  19. Audio & Video Capture Advanced Camera Controls Recording Media Real-Time

    Communication USB Credentials Payments Network Type & Speed Online State Vibration Battery Status Local Notifications Push Messages Home Screen Installation Foreground Detection Permissions File Reading Contacts SMS Serial Task Scheduling Touch Settings Speech Recognition Pointing Device Adaptation Offline Mode Background Sync Inter-App Communication NFC Geolocation WebShare Device Position Device Motion Wake Lock Proximity Sensors Ambient Light Virtual & Augmented Reality Fullscreen Screen Orientation & Lock Presentation Features Device Memory Bluetooth Real-Time Communication Touch Gestures Run on Startup Clipboard Access Storage Quotas Clipboard Access Unlimited Storage WebHID (HID) App Icon Badging Local Fonts Access
  20. “What are the plans so far?” Fugu API tracker https://goo.gle/fugu-api-tracker

    Existing Fugu tracking bugs https://bit.ly/fugu-bugs
  21. “Hey, I’d like something that’s not there” File a new

    Fugu bug! https://bit.ly/new-fugu-request
  22. “I want to help test these APIs!” File bugs and

    comment on existing ones! https://bugs.chromium.org/ Origin Trials https://developers.chrome.com/origintrials
  23. Thanks! Raphael Kubo da Costa [email protected] Pete LePage, Thomas Steiner,

    Rijubrata Bhaumik and Kenneth Christiansen have allowed me to borrow some slides, so thank you too!