Over the Air, London November 2016
<details>
, <summary>
<picture>
, srcset
<input type={week month datetime}
accesskey
returned to HTML4 definition@rev
returned<h1>
through <h6>
not <h1>
nested by section<input type="range" multiple>
MediaController
<label form="otherForm">
AppCache
<option></option>
is valid<figcaption>
can go anywhere inside <figure>
<dialog>
<style scoped>
contenteditable="??"
Enables push notifications in webapps
PushManager.subscribe()
PushSubscription
contains endpoint and encryption keyServiceWorkerGlobalScope.onpush
event handlerServiceWorkerRegistration.showNotification()
PushSubscription
PushRegistrationManager
interfaceEnables game controller support in browser-based games
The gamepadconnected
event fires when a gamepad is connected
window.addEventListener('gamepadconnected', function() {
console.log('Gamepad connected');
});
The navigator.getGamepads()
method returns an array of connected gamepads
window.addEventListener('gamepadconnected', function(e) {
var gamepad = navigator.getGamepads()[e.gamepad.index];
console.log('Gamepad connected: Index %d', gamepad.index);
});
id
: string of gamepad informationindex
: unique index numberconnected
: boolean indicating gamepad connection statebuttons
: array of GamepadButton
objectsaxes
: array of axis based controlstimestamp
: time the gamepad data was last updatedEnables simple haptic feedback from webapps
var vibrateOnce = function(e) {
window.navigator.vibrate(500);
};
var vibrateTwice = function(e) {
window.navigator.vibrate([500, 500, 500]);
};
var vibrateMore = function(e) {
window.navigator.vibrate([500, 500, 500, 500, 500]);
};
Locks mouse movement to a single element, removes the mouse cursor, and removes mouse movement boundaries
The requestPointerLock()
method locks the pointer to an element
canvas.requestPointerLock();
The pointerLockElement
property of the document
object
if (document.pointerLockElement === canvas) {
console.log('Pointer loc status: Locked');
}
The exitPointerLock()
method of the document
object
document.exitPointerLock();
The pointerlockchange
event fires when the pointer lock state changes
if ("onpointerlockchange" in document) {
document.addEventListener('pointerlockchange', someFunction, false);
}
The pointerlockerror
event fires when requestPointerLock()
or exitPointerLock()
fails
document.addEventListener('pointerlockerror', someFunction, false);
Enables speech input and output for webapps
<button data-hint="Use space or enter to activate">
Foo
</button>
if (window.SpeechSynthesisUtterance === undefined) {
alert("Browser does not support the Web Speech API");
} else {
// Do something
}
hints = document.querySelectorAll('[data-hint]'),
hoverTimeout;
speakHint = function(e) {
var msg = new SpeechSynthesisUtterance(e.target.dataset.hint);
window.speechSynthesis.speak(msg);
};
function focusEventListener(e) {
hoverTimeout = window.setTimeout(speakHint, 500, e);
}
function blurEventListener(e) {
window.clearTimeout(hoverTimeout);
}
function mouseoverEventListener(e) {
hoverTimeout = window.setTimeout(speakHint, 500, e);
}
function mouseoutEventListener(e) {
window.clearTimeout(hoverTimeout);
}
hints.forEach(function(hint) {
hint.addEventListener('focus', focusEventListener);
hint.addEventListener('blur', blurEventListener);
hint.addEventListener('mouseover', mouseoverEventListener);
hint.addEventListener('mouseout', mouseoutEventListener);
});