<?xml version="1.0" encoding="UTF-8"?> <feed xmlns="http://www.w3.org/2005/Atom"><title>Dev.Opera</title><link href="https://dev.opera.com/"/><link type="application/atom+xml" rel="self" href="https://dev.opera.com/feed/"/><updated>2017-02-07T17:38:22+00:00</updated><id>https://dev.opera.com/</id><author><name>Dev.Opera editors</name><email></email></author><entry><id>https://dev.opera.com/blog/opera-43/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-43/"/><title>What’s new in Chromium 56 and Opera 43</title><published>2017-02-07T00:00:00+00:00</published><updated>2017-02-07T00:00:00+00:00</updated><author><name>Simon Pieters</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 43 (based on Chromium 56) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/">Desktop</a> blog. Here’s what it means for web developers.</p>

<h2 id="prerender-from-address-bar">Prerender from address bar</h2>

<p>Opera will now prerender pages that are typed into the address bar, before the user hits enter,
which can make the page finish loading much sooner.</p>

<p>If you can predict what the user’s likely next navigation will be, you can start a prerender from
the current page by using <a href="https://w3c.github.io/resource-hints/#dfn-prerender"><code>&lt;link rel=prerender&gt;</code></a>.
This has actually been supported since Opera 15, but this seemed like a good opportunity for a
reminder. 🙂 For more information about how to use <code>prerender</code> and other resource hints, see
<a href="https://www.keycdn.com/blog/resource-hints/">Resource Hints – What is Preload, Prefetch, and Preconnect?</a>
by Brian Jackson.</p>

<h2 id="classic-link-selection">Classic link selection</h2>

<p>Opera now allows users to select link text instead of always dragging the link (like in Opera 12).
The user can select by dragging left or right, and start a drag-and-drop by dragging up or down.</p>

<p>Not being able to select text to copy and paste is often frustrating for users. But in some cases it
can be justified, like if a link is being used to act as a button, or if text is used only for
decoration. To disable text selection in general, CSS <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/user-select"><code>user-select: none</code></a>
can be used.</p>

<h2 id="scroll-anchoring-intervention">Scroll anchoring intervention</h2>

<p>When some content changes above the viewport (e.g., an image is loaded), what used to happen is that
the rest of the content is pushed down. With the <a href="https://github.com/WICG/ScrollAnchoring/blob/master/explainer.md">scroll anchoring</a>
intervention the scroll position is updated to keep the content currently in the viewport stable.
This behavior can be disabled for a specific subtree or for the whole page by using CSS <code>overflow-anchor: none</code>.
See <a href="https://www.youtube.com/watch?v=fejv0cM7Jig">this video</a> for a comparison with and without this
intervention.</p>

<h2 id="css">CSS</h2>

<ul>
  <li>Opera now supports <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/position#Sticky_positioning"><code>position: sticky</code></a>,
a new way to position elements. A <code>position: sticky</code> element is relatively-positioned, but becomes
<code>position: fixed</code> after the user reaches a certain scroll position. This results in smoother scroll
without jumps compared to trying to achieve the same thing with <code>scroll</code> events and JavaScript.
For more info see <a href="https://developers.google.com/web/updates/2016/12/position-sticky">this article</a>
by Paul Kinlan.</li>
  <li>The <a href="https://drafts.csswg.org/css-fonts-4/#extended-generics">new generic font family</a> <code>system-ui</code>
is now supported, which matches the platform’s default UI font.</li>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/CSS/touch-action"><code>touch-action: pinch-zoom</code></a> is now supported.</li>
  <li>Non-whitespace Unicode control characters will now be rendered according to the
<a href="https://drafts.csswg.org/css-text/#white-space-processing">specification</a>, rather than being ignored.</li>
</ul>

<h2 id="http-referrer-policy-header">HTTP <code>Referrer-Policy</code> header</h2>

<p>The new <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Referrer-Policy"><code>Referrer-Policy</code></a>
HTTP header allows sites to forward site traffic by URL without leaking the user’s session identifier
or other private information.</p>

<h2 id="events-keyboardeventiscomposing">Events: <code>keyboardEvent.isComposing</code></h2>

<p>The <a href="https://w3c.github.io/uievents/#idl-keyboardevent"><code>KeyboardEvent</code></a> interface now supports the
<a href="https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/isComposing"><code>isComposing</code></a> attribute
which returns <code>true</code> if this event is fired between <code>compositionstart</code> and <code>compositionend</code> events.</p>

<h2 id="canvas">Canvas</h2>

<p><a href="https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmapRenderingContext"><code>ImageBitmapRenderingContext</code></a>
can be used to reduce memory consumption and compositing overhead by rendering pixel data in the form
of an <a href="https://developer.mozilla.org/en-US/docs/Web/API/ImageBitmap"><code>ImageBitmap</code></a>.</p>

<h2 id="audiovideo">Audio/video</h2>

<ul>
  <li><a href="https://webaudio.github.io/web-audio-api/#ConstantSourceNode"><code>ConstantSourceNode</code></a> is a new audio source node that produces a constant output mixed with an <code>AudioParam</code>.</li>
  <li>Two Web Audio <a href="https://webaudio.github.io/web-audio-api/#the-channelsplitternode-interface"><code>ChannelSplitterNode</code></a> interface attributes are now read-only: <code>channelCount</code>, which is defined by <code>numberOfOutputs</code> in <code>createChannelSplitter()</code>, and <code>channelCountMode</code>, which is set to explicit.</li>
  <li><a href="https://webaudio.github.io/web-audio-api/#widl-PannerNode-rolloffFactor"><code>PannerNode.rolloffFactor</code></a> now clamps to the nominal range of a PannerNode’s distance model to describe the volume reduction rate as the source moves away from the listener.</li>
  <li>Support for <a href="https://en.wikipedia.org/wiki/FLAC">FLAC</a> is enabled within the FLAC and <a href="https://xiph.org/flac/ogg_mapping.html">Ogg</a> containers for the <code>audio</code> HTML element and <a href="https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/decodeAudioData"><code>decodeAudioData()</code></a>.</li>
  <li><a href="http://opus-codec.org/">OPUS</a> can now be used with <a href="https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/decodeAudioData"><code>decodeAudioData()</code></a>, expanding the variety of audio codecs supported by the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API">Web Audio API</a>.</li>
</ul>

<h2 id="shadow-dom">Shadow DOM</h2>

<ul>
  <li>Shadow DOM’s <a href="https://dom.spec.whatwg.org/#signaling-slot-change"><code>slotchange</code></a> events bubble, but no longer re-fires, at a <code>slot</code>’s <code>assignedSlot</code>.</li>
</ul>

<h2 id="deprecated-and-removed-features">Deprecated and removed features</h2>

<ul>
  <li>Non-script MIME types for external scripts (e.g., <code>&lt;script src="foo" type="something/something"&gt;</code>) was deprecated (generated a message in the console) in Opera 42 and now in Opera 43 are no longer pre-fetched. This typically results in less wasted fetches. <code>&lt;script data-src="foo" type="something/something"&gt;</code> is recommended instead.</li>
  <li>The Web Audio API no longer includes the deprecated Doppler API, including <code>speedOfSound</code>, <code>dopplerFactor</code>, and <code>setVelocity</code>.</li>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/RTCPeerConnection#RTCConfiguration_dictionary"><code>RTCPeerConnection</code></a> now accepts <code>iceTransportPolicy</code> as an <code>RTCConfiguration</code> parameter as well as <code>iceTransports</code>.</li>
  <li><a href="https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection"><code>RTCPeerConnection</code></a> is now available without a webkit prefix, though <code>webkitRTCPeerConnection</code> still remains.</li>
  <li>The <code>reflected-xss</code> directive has been removed from <a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy">Content Security Policy 2</a> since it was solely a wrapper for the <code>X-XSS-Protection</code> header and provided no additional functionality.</li>
  <li>Support for the <code>MediaStreamTrack.getSources()</code> method has been removed in favor of <code>MediaDevices.enumerateDevices()</code>.</li>
  <li>The CSP <code>referrer</code> directive is no longer supported in favor of the new <code>Referrer-Policy</code> header mentioned above.</li>
  <li>Legacy CBC-mode <a href="https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm">ECDSA</a> cipher suites ECDHE_ECDSA_WITH_AES_128_CBC_SHA and ECDHE_ECDSA_WITH_AES_256_CBC_SHA have been removed in favor of modern ciphers such as ECDHE_ECDSA_WITH_AES_128_GCM_SHA256.</li>
  <li>ECDSA with both SHA-1 and SHA-512 have been removed to reduce dependencies on SHA-1 and align with TLS 1.3’s new ECDSA handling.</li>
  <li><code>MIDIMessageEvent.receivedTime</code> has been deprecated in favor of <code>Event.timeStamp</code>, since <code>Event.timeStamp</code> now supports high-resolution monotonic time instead of epoch time.</li>
</ul>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-42/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-42/"/><title>What’s new in Chromium 55 and Opera 42</title><published>2016-12-14T00:00:00+00:00</published><updated>2016-12-14T00:00:00+00:00</updated><author><name>Simon Pieters</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 42 (based on Chromium 55) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/">Desktop</a> blog. Here’s what it means for web developers.</p>

<h2 id="built-in-currency-converter">Built-in currency converter</h2>

<p>Opera is now the first of the major browsers to add a built-in currency converter.</p>

<p>The user select the price they want to convert on the page and Opera will automatically show it in their local currency. Opera 42 supports conversion in 32 currencies based on daily values from the European Central Bank.</p>

<p>Currency symbols are supported, but for ambiguous symbols (e.g. “$”, “kr”) we recommend using the <a href="https://en.wikipedia.org/wiki/ISO_4217">ISO 4217</a> alphabetic code before or after the amount, as selectable text. This makes it unambiguous for Opera’s currency converter what to convert from, but it should also be helpful for end users and other tools in general.</p>

<pre><code>&lt;p&gt;USD 50&lt;/p&gt;
&lt;p&gt;995 SEK&lt;/p&gt;
</code></pre>

<h2 id="input-handling-improvements">Input handling improvements</h2>

<p>The <a href="https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent"><code>PointerEvent</code></a> standard is now supported. It gives developers a unified API for handling “pointer” user input, whether that is mouse, touch, pen, etc. <code>PointerEvent</code> also does not block scrolling, which should reduce jank during scrolling. When using <code>TouchEvent</code>, the same performance benefit can be achieved using <a href="https://developers.google.com/web/updates/2016/06/passive-event-listeners">passive event listeners</a>. The <a href="https://developers.google.com/web/updates/2016/10/pointer-events#default_actions"><code>touch-action</code></a> CSS property is now also supported, to allow reacting to gestures such as panning. For more information, see <a href="https://developers.google.com/web/updates/2016/10/pointer-events">Pointing the Way Forward</a> by Sérgio Gomes.</p>

<p>The <a href="https://developers.google.com/web/updates/2016/10/auxclick"><code>auxclick</code></a> event is now fired for non-primary mouse buttons, instead of <code>click</code>.</p>

<h2 id="javascript-async-and-await">JavaScript <code>async</code> and <code>await</code></h2>

<p>The <code>async</code> and <code>await</code> keywords are now supported, which allows writing Promise-based JavaScript with a neater syntax, and enables use of <code>try</code>/<code>catch</code> to catch rejected promises.</p>

<pre><code>async function myFirstAsyncFunction() {
	try {
		const fulfilledValue = await promise;
	}
	catch (rejectedValue) {
		// …
	}
}
</code></pre>

<p>For more information, see <a href="https://developers.google.com/web/fundamentals/getting-started/primers/async-functions">Async functions - making promises friendly</a> by Jake Archibald.</p>

<h2 id="css-automatic-hyphenation">CSS automatic hyphenation</h2>

<p>The <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/hyphens"><code>hyphens</code></a> CSS property is now supported (on Mac), which can be used to enable automatic hyphenation when text is broken across multiple lines. Possible values are <code>none</code>, <code>manual</code> (initial value) and <code>auto</code>.</p>

<p>For <code>none</code>, hyphenation will not happen even when <code>&amp;shy;</code> is used. For <code>manual</code>, hyphenation only happens for <code>&amp;shy;</code>. For <code>auto</code>, automatic hyphenation happens, based on the language specified in the <code>lang</code> attribute.</p>

<pre><code>html { hyphens: auto; }
code { hyphens: manual; }
</code></pre>

<p>See <a href="https://googlechrome.github.io/samples/css-hyphens/">demo</a>.</p>

<h2 id="once-event-listener-option"><code>once</code> event listener option</h2>

<p>The <a href="https://dom.spec.whatwg.org/#dom-addeventlisteneroptions-once"><code>once</code> event listener option`</a> is now supported, for a convenient way to only invoke an event listener once and then remove the listener.</p>

<pre><code>element.addEventListener('click', function(event) {
	// ...one-time handling of the click event...
}, {once: true});
</code></pre>

<p>For more information, see <a href="https://developers.google.com/web/updates/2016/10/addeventlistener-once">Once Upon an Event Listener</a> by Jeff Posnick.</p>

<h2 id="persistent-storage">Persistent storage</h2>

<p><a href="https://developers.google.com/web/updates/2016/06/persistent-storage">Persistent storage</a> is now on by default.</p>

<h2 id="tls">TLS</h2>

<ul>
  <li>The TLS stack now implements <a href="https://tools.ietf.org/id/draft-davidben-tls-grease-00.html">GREASE</a>, a mechanism to help prevent problems with buggy TLS servers.</li>
  <li>RSA-PSS signature algorithms have been added to TLS to prepare for <a href="https://tlswg.github.io/tls13-spec/">TLS 1.3</a>.</li>
</ul>

<h2 id="new-constructors">New constructors</h2>

<p><code>new MediaStreamTrackEvent(type, options)</code> and <code>new AudioNode(context, options)</code> constructors are now available.</p>

<h2 id="documentwrite-intervention"><code>document.write()</code> intervention</h2>

<p>Cross-origin and parser-blocking scripts injected using <code>document.write()</code> will no longer load over 2G connections. See <a href="https://developers.google.com/web/updates/2016/08/removing-document-write">this article</a> by Paul Kinlan for more information.</p>

<h2 id="deprecated-and-removed-features">Deprecated and removed features</h2>

<ul>
  <li>As mentioned above, the <code>click</code> event is no longer fired for non-primary mouse buttons. In most cases this is desirable; <code>click</code> event handlers are most often intended to handle primary clicks. But if you need to handle non-primary clicks (e.g., middle mouse button), the <code>auxclick</code> event can be used. The <code>contextmenu</code> event can also be used to handle clicks that would open a context menu (typically right-click).</li>
  <li><code>BaseAudioContext</code> will replace <code>AudioContext</code> in the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API">Web Audio API</a>.</li>
  <li>CSS Clipping Path properties no longer require the <code>webkit</code> prefix.</li>
  <li>The <code>MediaStream</code> constructor is now available without prefix alongside the existing <code>webkitMediaStream</code>.</li>
  <li>Non-script MIME types for external scripts (e.g., <code>&lt;script src="foo" type="something/something"&gt;</code>) is deprecated and will from M56 (Opera 43) no longer be pre-fetched. This typically results in less wasted fetches. <code>&lt;script data-src="foo" type="something/something"&gt;</code> is recommended instead.</li>
  <li><code>&lt;textarea maxlength=""&gt;</code> and <code>&lt;textarea minlength=""&gt;</code> have been updated to count each line break as one character, instead of two.</li>
  <li>The <code>webkit</code> prefix has been removed from the <code>imageSmoothingEnabled</code> property of <code>CanvasRenderingContext2D</code>.</li>
</ul>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-41/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-41/"/><title>What’s new in Chromium 54 and Opera 41</title><published>2016-10-25T00:00:00+00:00</published><updated>2016-10-25T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 41 (based on Chromium 54) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/">Desktop</a> blog. Here’s what it means for web developers.</p>

<h2 id="web-components-custom-elements-v1">Web Components: Custom Elements v1</h2>

<p>Custom elements form the foundation of <a href="http://webcomponents.org/">web components</a>. The initial version of the API, also known as Custom Elements v0, has been supported since Opera 20 &amp; Chrome 33. With the v0 API, a new custom element was defined using <code>document.registerElement()</code>.</p>

<p>Since then, the spec has been updated based on web developer and browser vendor feedback. The improved API is called <a href="https://html.spec.whatwg.org/multipage/scripting.html#custom-elements">Custom Elements v1</a>. The new hip &amp; trendy way of defining a custom element is through <code>customElements.define()</code>. The v0 API is now deprecated and will be removed in a future release.</p>

<p>For more details, check out <a href="https://developers.google.com/web/fundamentals/getting-started/primers/customelements">Eric Bidelman’s custom elements guide</a>.</p>

<h2 id="dom-convenience-methods-on-parentnode--childnode">DOM convenience methods on <code>ParentNode</code> &amp; <code>ChildNode</code></h2>

<p>We now support the following convenience methods on <a href="https://dom.spec.whatwg.org/#parentnode">ParentNode</a> and <a href="https://dom.spec.whatwg.org/#childnode">ChildNode</a> for working with DOM trees:</p>

<ul>
  <li><code>ParentNode.prototype.prepend()</code></li>
  <li><code>ParentNode.prototype.append()</code></li>
  <li><code>ChildNode.prototype.before()</code></li>
  <li><code>ChildNode.prototype.after()</code></li>
  <li><code>ChildNode.prototype.replaceWith()</code></li>
</ul>

<h2 id="canvasrenderingcontext2dprototypeimagesmoothingquality"><code>CanvasRenderingContext2D.prototype.imageSmoothingQuality</code></h2>

<p><a href="https://html.spec.whatwg.org/multipage/scripting.html#imagesmoothingquality"><code>CanvasRenderingContext2D.prototype.imageSmoothingQuality</code></a> allows developers to balance performance and image quality by adjusting resolution when scaling.</p>

<pre><code>const canvas = document.querySelector('canvas');
const context = canvas.getContext('2d');
const image = new Image();
image.src = 'image.png';
image.onload = function() {
	context.imageSmoothingEnabled = true;
	context.imageSmoothingQuality = 'high'; // or 'low', or 'medium'
	context.drawImage(image, 0, 0, 320, 180);
};
</code></pre>

<h2 id="broadcastchannel-api">BroadcastChannel API</h2>

<p><a href="https://html.spec.whatwg.org/multipage/comms.html#broadcasting-to-other-browsing-contexts">The BroadcastChannel API</a> allows same-origin scripts to send messages to other browsing contexts. It can be thought of as a simple message bus that allows publish-subscribe semantics between windows, tabs, <code>iframe</code>s, web workers, and service workers. Think of it as a simpler, same-origin version of the good ol’ <code>postMessage()</code> API.</p>

<p>For more information, check out <a href="https://developers.google.com/web/updates/2016/09/broadcastchannel">this article</a>.</p>

<h2 id="cache-storage-api-cachequeryoptions">Cache Storage API: <code>CacheQueryOptions</code></h2>

<p>The full set of <a href="https://w3c.github.io/ServiceWorker/#dictdef-cache-cachequeryoptions"><code>CacheQueryOptions</code></a> is now supported, making it easier to find the cached responses you’re looking for. Here’s the complete list of available options:</p>

<ul>
  <li><code>ignoreSearch</code></li>
  <li><code>ignoreMethod</code></li>
  <li><code>ignoreVary</code></li>
  <li><code>cacheName</code></li>
</ul>

<p>See <a href="https://developers.google.com/web/updates/2016/09/cache-query-options">Jeff Posnick’s excellent article</a> for more information.</p>

<h2 id="css-text-size-adjust">CSS <code>text-size-adjust</code></h2>

<p><a href="https://drafts.csswg.org/css-size-adjust/">The <code>text-size-adjust</code> property</a> lets web developers control and disable <a href="https://developer.mozilla.org/en-US/docs/Web/CSS/text-size-adjust">the text autosizing feature</a> which increases font sizes on mobile.</p>

<h2 id="unprefixed-css-user-select">Unprefixed CSS <code>user-select</code></h2>

<p>You can now use <a href="https://drafts.csswg.org/css-ui-4/#content-selection"><code>user-select</code></a> instead of <code>-webkit-user-select</code> in CSS. The <code>user-select</code> property makes it possible to specify which elements in the document can be selected by the user and how.</p>

<h2 id="navigations-in-unload-handlers-now-blocked">Navigations in <code>unload</code> handlers now blocked</h2>

<p>Navigations initiated in an <code>unload</code> handler are now <a href="https://groups.google.com/a/chromium.org/d/msg/blink-dev/VfItzNe3WO0/Zo95RMlTAwAJ">blocked</a>. Instead, any prior navigation will continue. This matches the behavior in Firefox, and matches Edge’s behavior more closely than before.</p>

<h2 id="nodeprototypegetrootnode"><code>Node.prototype.getRootNode</code></h2>

<p>Sites can use <a href="https://dom.spec.whatwg.org/#dom-node-getrootnode">Node.prototype.getRootNode(options)</a> to obtain the root for a given node.</p>

<h2 id="experimenting-with-post-quantum-crypto-for-tls">Experimenting with post-quantum crypto for TLS</h2>

<p>CECPQ1 is a post-quantum cipher suite: one that is designed to provide confidentiality even against an attacker who possesses a large quantum computer. It is a key-agreement algorithm plugged into TLS that combines X25519 and NewHope, a ring-learning-with-errors primitive. Even if NewHope turns out to be breakable, the X25519 key-agreement will ensure that it provides at least the security of our existing connections.</p>

<p>Note that this is only an experiment. In fact, the plan is to discontinue this experiment within two years, hopefully by replacing it with something better. See <a href="https://security.googleblog.com/2016/07/experimenting-with-post-quantum.html">“Experimenting with post-quantum cryptography”</a> for more details.</p>

<h2 id="deprecated-and-removed-features">Deprecated and removed features</h2>

<p><code>URL.createObjectURL</code> and <code>URL.revokeObjectURL</code> are now deprecated in service worker contexts.</p>

<p><a href="https://w3c.github.io/mediacapture-main/">The MediaStream API</a> dropped <code>MediaStream.prototype.ended</code> a long time ago. Its usage has been <a href="https://dev.opera.com/blog/opera-32/#mediastream-api">deprecated since Opera 32 &amp; Chromium 45</a>. As of this release, the <code>ended</code> event is no longer supported.</p>

<p>Similarly, <a href="https://w3c.github.io/FileAPI/">the File API spec</a> once removed the <code>FileError</code> interface. It has been deprecated since 2013. Any usage of <code>FileError</code> triggered a warning in the DevTools console <a href="https://dev.opera.com/blog/opera-40/#deprecated-and-removed-features">since Opera 40 &amp; Chromium 53</a>. As of this release, <code>FileError</code> is no longer supported.</p>

<p>Support for the non-standard <code>TouchEvent.prototype.initTouchEvent</code> has been removed, after being <a href="https://dev.opera.com/blog/opera-36/#deprecated-or-removed-features">deprecated since Opera 36 &amp; Chromium 49</a>. Use <a href="https://dev.opera.com/blog/opera-35/#touch-and-touchevent-constructors">the <code>Touch</code> and <code>TouchEvent</code> constructors</a> instead.</p>

<p>To more closely match other browser’s behavior, <code>window.external.IsSearchProviderInstalled</code> and <code>window.external.AddSearchProvider</code> (originally intended to <a href="https://developer.mozilla.org/en-US/docs/Web/API/Window/sidebar/Adding_search_engines_from_Web_pages">add search engines programmatically</a>) are now both no-ops. This functionality was never implemented in Safari. In IE10, these methods are (mostly) no-ops: <code>IsSearchProviderInstalled</code> always returns <code>2</code>, and <code>AddSearchProvider</code> always returns <code>S_OK</code>. Firefox still implements this, but notes that it may be removed at any time.</p>

<p><code>KeyboardEvent.prototype.keyIdentifier</code> has been removed. Use <a href="https://w3c.github.io/uievents/#dom-keyboardevent-key"><code>KeyboardEvent.prototype.key</code></a> (or <a href="https://github.com/cvan/keyboardevent-key-polyfill">its polyfill</a>) instead.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-40/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-40/"/><title>What’s new in Chromium 53 and Opera 40</title><published>2016-09-20T00:00:00+00:00</published><updated>2016-09-20T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 40 (based on Chromium 53) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/">Desktop</a> blog. Here’s what it means for web developers.</p>

<h2 id="improved-input-pattern">Improved <code>&lt;input pattern="…"&gt;</code></h2>

<p><a href="https://mathiasbynens.be/notes/es6-unicode-regex">The <code>u</code> flag (which stands for Unicode)</a> is now applied to any regular expressions compiled through <a href="https://html.spec.whatwg.org/multipage/forms.html#the-pattern-attribute">the <code>pattern</code> attribute</a> for <code>&lt;input&gt;</code> and <code>&lt;textarea&gt;</code> elements.
This enables more Unicode-friendly features, and generally more sensible behavior.</p>

<pre><code>&lt;input pattern="[🍪🎂🍩]"&gt;
&lt;!--
	The input only validates when it is either 🍪, 🎂, or 🍩.
	(Previously, those strings would fail validation.)
--&gt;
</code></pre>

<p><a href="https://mathiasbynens.be/demo/pattern-u">A demo is available.</a></p>

<h2 id="iframe-sandboxallow-presentation"><code>&lt;iframe sandbox="allow-presentation"&gt;</code></h2>

<p><a href="https://w3c.github.io/presentation-api/#sandboxing-and-the-allow-presentation-keyword">The Presentation API</a> defines the nw <code>allow-presentation</code> sandboxing flag for <a href="https://html.spec.whatwg.org/multipage/embedded-content.html#attr-iframe-sandbox"><code>&lt;iframe sandbox="…"&gt;</code></a> which gives web developers control over whether an <code>iframe</code> can start a presentation session. By default, the Presentation API is disabled in sandboxed <code>&lt;iframe&gt;</code>s.</p>

<h2 id="shadow-dom-v1">Shadow DOM v1</h2>

<p>All browser vendors finally agreed on <a href="https://w3c.github.io/webcomponents/spec/shadow/">the Shadow DOM spec</a>, called <em>v1</em>. The new Shadow DOM APIs include:</p>

<ul>
  <li><code>Element.attachShadow</code></li>
  <li><code>Event.prototype.composed</code></li>
  <li><code>Event.prototype.composedPath()</code></li>
  <li><code>HTMLSlotElement</code></li>
  <li><code>Slotable.prototype.assignedSlot</code></li>
</ul>

<p>For more information, check out <a href="http://hayato.io/2016/shadowdomv1/">Hayato Ito’s overview of the differences between Shadow DOM v0 and v1</a>.</p>

<h2 id="mediastreamtrack-constraints-api"><code>MediaStreamTrack</code> Constraints API</h2>

<p>The following <a href="https://w3c.github.io/mediacapture-main/getusermedia.html#mediastreamtrack"><code>MediaStreamTrack</code></a> methods are now supported:</p>

<ul>
  <li><code>getCapabilities</code></li>
  <li><code>getConstraints</code></li>
  <li><code>getSettings</code></li>
  <li><code>applyConstraints</code></li>
</ul>

<p>These APIs allow getting, setting, and querying constraints on a <code>MediaStreamTrack</code>.</p>

<p>Additionally, <a href="https://w3c.github.io/mediacapture-main/getusermedia.html#idl-def-mediatrackconstraints"><code>MediaTrackConstraints</code></a> instances now have <code>video</code> and <code>audio</code> properties.</p>

<h2 id="promise-based-getusermedia">Promise-based <code>getUserMedia</code></h2>

<p><a href="https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia">The <code>navigator.mediaDevices.getUserMedia()</code> API</a>, which returns a promise, is now supported. Also, the unprefixed version of <a href="https://w3c.github.io/mediacapture-main/getusermedia.html#local-content"><code>navigator.getUserMedia()</code></a> (which uses callbacks) is now available. For more info, see <a href="https://developers.google.com/web/updates/2015/10/media-devices#getusermedia">Sam Dutton’s write-up</a>.</p>

<h2 id="unprefixed-css-filter">Unprefixed CSS <code>filter</code></h2>

<p><a href="https://drafts.fxtf.org/filters/">The CSS <code>filter</code> property</a> is now supported in its unprefixed form. For now, <code>-webkit-filter</code> is still supported as an alias for <code>filter</code>. <a href="http://bennettfeely.com/filters/">A demo featuring SpongeBob SquarePants is available.</a></p>

<h2 id="css--webkit-user-select-all">CSS <code>-webkit-user-select: all</code></h2>

<p>Chromium already supported <code>-webkit-user-select</code>, the prefixed version of <a href="https://drafts.csswg.org/css-ui-4/#content-selection"><code>user-select</code></a>, but it didn’t recognize every value the spec defines. As of this update, the <code>-webkit-user-select: all</code> is supported. This property/value pair makes it so that if a selection would contain only part of an element, then the selection must contain the entire element including all its descendants.</p>

<p>For example, if you apply this on all <code>&lt;p&gt;</code> elements, and you then try to select a single word in a paragraph, the entire paragraph is selected automatically.</p>

<p>The <a href="https://css-tricks.com/almanac/properties/u/user-select/">CSS Tricks Almanac entry for <code>user-select</code></a> features a nice demo.</p>

<h2 id="force-flattening-when-ancestor-has-opacity">Force flattening when ancestor has opacity</h2>

<p>3D-positioned descendants are now flattened by an ancestor that has opacity. Previously that didn’t happen if that ancestor also specified <code>transform-style: preserve-3d</code>. <a href="https://googlechrome.github.io/samples/css-opacity-force-flattening/">A visual demo explains this better than words ever could.</a></p>

<h2 id="rasterization--will-change-transform">Rasterization &amp; <code>will-change: transform</code></h2>

<p>Generally, all content is re-rastered when its transform scale changes, unless <code>will-change: transform</code> is applied to it. In other words, <code>will-change: transform</code> effectively means “please apply the transformation quickly, without taking the additional time for rasterization”. This only applies to scaling that happens via JavaScript manipulation, and does not apply to CSS animations. For more information, see the <a href="https://docs.google.com/document/d/1f8WS99F9GORWP_m74l_JfsTHgCrHkbEorHYu72D4Xag/edit?usp=sharing">technical summary for this change</a>. <a href="https://googlechrome.github.io/samples/css-will-change-transform-rasterization/">A demo is available.</a></p>

<h2 id="deprecated-and-removed-features">Deprecated and removed features</h2>

<p>Synthetic events (i.e. those who are created by JavaScript, and are thus untrusted) are now prevented from executing their default action. <code>click</code> is the only exception for backwards compatibility with legacy content. This change matches <a href="https://w3c.github.io/uievents/#trusted-events">the spec</a> and other browsers.</p>

<p><a href="https://github.com/whatwg/html/commit/99f0f1ae017523276ea4dd5784ec63a23a23834d">The HTML spec</a> was changed so that <code>&lt;label&gt;</code> elements aren’t form-associated elements anymore. As a result, support for the <code>form</code> attribute on <code>&lt;label&gt;</code> elements was removed, and <code>labelElement.form</code> is now an alias for <code>labelElement.control.form</code> (instead of mapping to the <code>form</code> attribute value).</p>

<p>HTTP/0.9, the predecessor to HTTP/1.x, is now deprecated, and will be removed in a future release. Its replacement, HTTP/1.0, was standardized 20 years ago.</p>

<p>Support for DHE-based TLS ciphers has been removed, after being <a href="https://dev.opera.com/blog/opera-38/#deprecated-and-removed-features">deprecated in Chromium 51 &amp; Opera 38</a>. Servers should upgrade to ECDHE ciphers instead.</p>

<p>A long time ago, <a href="https://w3c.github.io/FileAPI/">the File API spec</a> was changed to remove the <code>FileError</code> interface. It has been deprecated since 2013. As we’re preparing to remove this interface entirely in a future release, any usage of <code>FileError</code> now triggers a warning in the DevTools console.</p>

<p><a href="https://encoding.spec.whatwg.org/#textencoder">The TextEncoder API</a> no longer accepts an argument that specifies the encoding. Instead, it always uses UTF-8. If an argument is passed, it is ignored. This means that <code>new TextEncoder('utf-16')</code> and <code>new TextEncoder('utf-16be')</code> no longer work.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-39/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-39/"/><title>What’s new in Chromium 52 and Opera 39</title><published>2016-08-02T00:00:00+00:00</published><updated>2016-08-02T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 39 (based on Chromium 52) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/2016/08/personalized-newsreader-improved-video-popout-in-opera39/">Desktop</a> blog. Here’s what it means for web developers.</p>

<h2 id="es2016-exponentiation-operator">ES2016 exponentiation operator</h2>

<p>ES2016 introduces <a href="https://tc39.github.io/ecma262/#sec-exp-operator">an arithmetic operator equivalent</a> of <code>Math.pow(base, exponent)</code>, in which the lefthand-side expression serves as the base value, and the righthand-side expression serves as the exponent.</p>

<pre><code>4 ** 3;
// → 64

let value = 4;
value **= 3;
value;
// → 64
</code></pre>

<h2 id="fetch-api-response-construction-with-readablestream">Fetch API: <code>Response</code> construction with <code>ReadableStream</code></h2>

<p>It’s now possible to construct your own <code>ReadableStream</code> instances and to use them as bodies for <code>Response</code> objects, including from within service workers. This functionality is part of <a href="https://fetch.spec.whatwg.org/">the Fetch standard</a>. See <a href="https://developers.google.com/web/updates/2016/06/sw-readablestreams">Jeff Posnick’s write-up</a> for details, or <a href="https://jakearchibald.com/2016/streams-ftw/">Jake Archibald’s</a> in-depth blog post on streams for even more info.</p>

<h2 id="fetch-api-referrer-policy">Fetch API: referrer policy</h2>

<p>Requests made using <a href="https://fetch.spec.whatwg.org/">the Fetch API</a> can use a specific referrer policy, which affects the value of the <code>Referer</code> HTTP header that’s sent to remote servers. This can be done by adding a <code>referrerPolicy</code> property to the options object passed to <code>fetch</code>, which accepts the following values:</p>

<ul>
  <li><code>'no-referrer'</code></li>
  <li><code>'no-referrer-when-downgrade'</code></li>
  <li><code>'origin'</code></li>
  <li><code>'origin-when-cross-origin'</code></li>
  <li><code>'unsafe-url'</code></li>
</ul>

<p>See <a href="https://hacks.mozilla.org/2016/03/referrer-and-cache-control-apis-for-fetch/">Ehsan Akhgari’s write-up</a> for a straight-forward  explanation of these values.</p>

<pre><code>fetch(url, { 'referrerPolicy': 'no-referrer' })
	.then(function(response) {
		// Do something with the `response`…
	});
</code></pre>

<p><a href="https://googlechrome.github.io/samples/fetch-api/fetch-referrer-policy.html">A demo is available.</a></p>

<h2 id="d-canvas-filters">2D canvas filters</h2>

<p><code>CanvasRenderingContext2D</code> instances now support the <code>filter</code> property that applies effects to primitives drawn to the canvas. The <code>filter</code> value is parsed in the same way as <a href="https://drafts.fxtf.org/filters/#FilterProperty">CSS filters</a>.</p>

<pre><code>const canvas = document.querySelector('canvas');
const context = canvas.getContext('2d');
context.filter = 'saturate(6.3)';
</code></pre>

<h2 id="createimagebitmap-options"><code>createImageBitmap</code> options</h2>

<p>An <code>ImageBitmapOptions</code> object is an <code>options</code> object that can be passed to <code>createImageBitmap()</code>.</p>

<pre><code>createImageBitmap(image, options).then(function(response) {
	// Do something with the `response`…
});
</code></pre>

<p>The available options are:</p>

<ul>
  <li><code>colorSpaceConversion</code> indicates whether the image is decoded using color space conversion. Either <code>'none'</code> or <code>'default'</code> (default). The value <code>'default'</code> indicates that implementation-specific behavior is used.</li>
  <li><code>imageOrientation</code> indicates whether the image is presented as-is or flipped vertically. Either <code>'flipY'</code> or <code>'none'</code> (default).</li>
  <li><code>premultiplyAlpha</code> indicates that the bitmap color channels are premultiplied by the alpha channel. One of <code>'none'</code>, <code>'premultiply'</code>, or <code>'default'</code> (default).</li>
  <li><code>resizeWidth</code> indicates the new width.</li>
  <li><code>resizeHeight</code> indicates the new height.</li>
  <li><code>resizeQuality</code> specifies an image scaling algorithm. One of <code>'pixelated'</code>, <code>high'</code>, <code>'medium'</code>, or <code>'low'</code> (default).</li>
</ul>

<h2 id="invalid-track-kind-values-are-no-longer-treated-as-subtitles">Invalid <code>&lt;track kind&gt;</code> values are no longer treated as subtitles</h2>

<p>Invalid values for <a href="https://html.spec.whatwg.org/multipage/embedded-content.html#attr-track-kind"><code>&lt;track kind&gt;</code></a> were previously treated as <code>'subtitles'</code>. This means that any new values would be treated as subtitles by old browsers. Chromium now uses <code>'metadata'</code> instead as the “invalid value default”, to avoid browsers showing <code>&lt;track&gt;</code>s with unrecognized values.</p>

<h2 id="htmlmediaelementprototypesrcobject"><code>HTMLMediaElement.prototype.srcObject</code></h2>

<p>The <code>srcObject</code> property on HTMLMediaElement instances enables associating a <code>MediaStream</code> to a media element using a simple assignment. Previously, achieving this required first obtaining a URL associated to the <code>MediaStream</code>, and then associating this URL to the media element.</p>

<p>Currently, only <code>MediaStream</code> objects are accepted because it is the only type currently supported by other major browsers, but Chromium aims to support more types in the future. (Per the spec, a <code>MediaProvider</code> can be a <code>MediaStream</code>, a <code>MediaSource</code>, or a <code>Blob</code>.)</p>

<h2 id="web-audio-updates">Web Audio updates</h2>

<p><a href="https://webaudio.github.io/web-audio-api/#AudioParam"><code>AudioParam</code> instances</a> now have readonly <code>minValue</code> and <code>maxValue</code> properties that specify the minimum and maximum values the <code>AudioParam</code> can have. The <code>value</code> is clamped to lie in this range</p>

<p>Automation methods for the position and orientation coordinates of <a href="https://webaudio.github.io/web-audio-api/#the-pannernode-interface"><code>PannerNode</code></a> and the <code>position{X,Y,Z}</code>, <code>up{X,Y,Z}</code>, and <code>forward{X,Y,Z}</code> vectors of <a href="https://webaudio.github.io/web-audio-api/#AudioListener"><code>AudioListener</code></a> are now available. This allows smooth changes in the coordinates using <code>AudioParam</code> methods.</p>

<p>Chromium now implements the <code>reduction</code> property on <code>DynamicsCompressorNode</code> instances as a readonly float, matching the spec. Previously, the value was represented as an <code>AudioParam</code>.</p>

<h2 id="idbkeyrangeprototypeincludes"><code>IDBKeyRange.prototype.includes()</code></h2>

<p><a href="https://w3c.github.io/IndexedDB/#dom-idbkeyrange-includes">The <code>includes</code> method on <code>IDBKeyRange</code> instances</a> tests whether or not a key exists within the bounds of the range. Until all other browsers support this natively, <a href="https://developer.mozilla.org/en-US/docs/Web/API/IDBKeyRange/includes#Polyfill">a polyfill</a> can be used.</p>

<h2 id="webrtc-storing-rtccertificates-in-indexeddb">WebRTC: Storing <code>RTCCertificate</code>s in IndexedDB</h2>

<p><a href="https://w3c.github.io/webrtc-pc/#rtccertificate-interface"><code>RTCCertificate</code>s</a> are self-signed certificates used in the DTLS handshake when setting up a connection with an <code>RTCPeerConnection</code>. Chromium now allows web applications to store <code>RTCCertificate</code>s by implementing the structured clone algorithm. This means <code>RTCCertificate</code>s can be saved and loaded from an IndexedDB database, saving the cost of generating new certificates for new sessions.</p>

<h2 id="performance-observer">Performance Observer</h2>

<p><a href="https://w3c.github.io/performance-timeline/#the-performanceobserver-interface">The Performance Observer API</a> is essentially a streaming interface that can be used to gather low-level timing information asynchronously, as it’s gathered by the browser. <a href="https://developers.google.com/web/updates/2016/06/performance-observer">Marc Cohen’s write-up</a> does a great job explaining it.</p>

<h2 id="pause-event-loop-during-modal-dialogs">Pause event loop during modal dialogs</h2>

<p>When using <code>alert()</code>, <code>confirm()</code> or <code>onbeforeunload</code>, Chromium’s old behavior was to block JavaScript while waiting for the result, but to allow all declarative animations to continue. As of this update, Chromium makes all main-thread tasks (such as <code>&lt;marquee&gt;</code> and CSS 2D animations) also <a href="https://html.spec.whatwg.org/multipage/webappapis.html#pause">pause</a> during this interval.</p>

<p><a href="https://jsfiddle.net/v07nfvf9/">Here’s a demo</a> showing the impact of <code>alert()</code> on a CSS 2D animation.</p>

<h2 id="css-containment">CSS <code>contain</code>ment</h2>

<p><a href="https://drafts.csswg.org/css-containment/#contain-property">The CSS <code>contain</code> property</a> indicates that an element and its contents are, as much as possible, independent of the rest of the document tree. This allows the browser to recalculate layout (<code>contain: layout</code>), style (<code>contain: style</code>), paint (<code>contain: paint</code>), size (<code>contain: size</code>), or any combination of them for a limited area of the DOM and not the entire page. For more details, <a href="https://developers.google.com/web/updates/2016/06/css-containment">check out Paul Lewis’ explanation</a>.</p>

<h2 id="css-font-variant-caps--font-variant-numeric">CSS <code>font-variant-caps</code> &amp; <code>font-variant-numeric</code></h2>

<p>The CSS properties <a href="https://drafts.csswg.org/css-fonts/#font-variant-caps-prop"><code>font-variant-caps</code></a> and <a href="https://drafts.csswg.org/css-fonts/#font-variant-caps-numeric"><code>font-variant-numeric</code></a> are now supported.</p>

<h2 id="meter---webkit-appearance-none-"><code>meter { -webkit-appearance: none; }</code></h2>

<p>Previously, there was no way to completely disable the browser’s default rendering of <code>&lt;meter&gt;</code> elements and to restyle them using CSS. As of Chrome 52 / Opera 39, this finally became possible using <a href="https://drafts.csswg.org/css-ui-4/#appearance-switching"><code>-webkit-appearance: none</code></a>.</p>

<h2 id="new-css-flexbox-behavior-for-absolutely-positioned-children">New CSS Flexbox behavior for absolutely-positioned children</h2>

<p>The static position of absolutely-positioned children used to be set as though they were a 0×0 flex item. <a href="https://drafts.csswg.org/css-flexbox/#abspos-items">The CSS Flexible Box Layout spec</a> has since been updated to <a href="https://developers.google.com/web/updates/2016/06/absolute-positioned-children">take such children fully out of flow</a> and to set the static position based on <code>align</code> and <code>justify</code> properties. <a href="https://googlechrome.github.io/samples/css-flexbox-abspos/">Check out the demo.</a></p>

<h2 id="alternative-services">Alternative Services</h2>

<p><a href="https://tools.ietf.org/html/rfc7838">Alternative Services</a> allow an origin serving an <code>http://</code> or <code>https://</code> resource to nominate additional origins that the client can choose to request the resource from instead when making subsequent requests. This can be used, for example, as a protocol upgrade mechanism, for connection pooling, or for load balancing.</p>

<p>This is done through the <code>Alt-Used</code> HTTP header.</p>

<p>For example, if the resource at <code>https://origin.example.com/foo</code> returns the following response headers:</p>

<pre><code>Alt-Used: https://alternate.example.net
</code></pre>

<p>…and <code>https://origin.example.com/bar</code> is requested afterwards, then the browser may fetch either <code>https://origin.example.com/bar</code> or <code>https://alternate.example.net/bar</code>.</p>

<h2 id="csp3-strict-dynamic">CSP3 <code>strict-dynamic</code></h2>

<p><a href="https://w3c.github.io/webappsec-csp/#strict-dynamic-usage">The <code>'strict-dynamic'</code> source expression</a> allows scripts loaded via nonce- or hash-based whitelists to load other scripts. Deploying CSP is now simpler than ever before. <a href="https://csp-experiments.appspot.com/unsafe-dynamic">A demo is available.</a></p>

<h2 id="deprecated-and-removed-features">Deprecated and removed features</h2>

<p><code>X-Frame-Options</code> is now ignored when present inside a <code>&lt;meta&gt;</code> tag, e.g. <code>&lt;meta http-equiv="X-Frame-Options" contents="DENY"&gt;</code>, matching <a href="https://tools.ietf.org/html/rfc7034#section-4">the spec</a>. Use an HTTP header (<code>X-Frame-Options: DENY</code>) instead.</p>

<p>A non-standard and little-used variant of the <code>postMessage()</code> API is being deprecated, specifically <code>postMessage(message, transferables, targetOrigin)</code>. Use <code>postMessage(message, targetOrigin, transferables)</code> instead.</p>

<p>The <code>ended</code> event &amp; property and the <code>onended</code> event handler have been removed from <a href="https://w3c.github.io/mediacapture-main/">the Media Capture and Streams spec</a> and are now being deprecated in Chromium.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/recent-pwa-talks-videos/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/recent-pwa-talks-videos/"/><title>Progressive Web Apps presentations at Web Rebels and the PWA Dev Summit</title><published>2016-06-29T00:00:00+00:00</published><updated>2016-06-29T00:00:00+00:00</updated><author><name>Andreas Bovens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>A few weeks ago, I had the pleasure to <a href="https://opbeat.com/events/web-rebels-2016/#towards-better-apps-the-what-why-of-progressive-web-apps">give a talk</a> about progressive web apps at the <a href="https://www.webrebels.org/">Web Rebels conference</a> in Oslo. If you want to get a quick intro to the what and why of progressive web apps, do check it out.</p>

<figure block="figure">
	<iframe elem="media" width="560" height="348" src="https://fast.wistia.net/embed/iframe/k88z4s2qtp" allowfullscreen=""></iframe>
</figure>

<p>Last week, I <a href="https://www.youtube.com/watch?v=yMxQ0fhj89I">presented</a> at Google’s <a href="https://events.withgoogle.com/progressive-web-app-dev-summit/">Progressive Web App Dev Summit</a> in Amsterdam. In my talk, I covered novel UX patterns in progressive web apps, emerging markets and Opera Mini compatibility, and introduced a couple of <a href="https://dev.opera.com/blog/pwa-badge-pop/">new ideas</a> to solve some of the discoverability issues progressive web apps struggle with.</p>

<figure block="figure">
	<iframe elem="media" width="560" height="315" src="https://www.youtube.com/embed/yMxQ0fhj89I" allowfullscreen=""></iframe>
</figure>

<p>My talk there was followed by a <a href="https://www.youtube.com/watch?v=EyyEfxrk_NU">browser panel</a>, in which I participated as well. You can find a video of it below.</p>

<figure block="figure">
	<iframe elem="media" width="560" height="315" src="https://www.youtube.com/embed/EyyEfxrk_NU" allowfullscreen=""></iframe>
</figure>

<p>If you have any questions about progressive web apps, do check out our <a href="https://dev.opera.com/tags/pwa/">other articles</a> or <a href="https://twitter.com/odevrel">ask a question</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/pwa-badge-pop/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/pwa-badge-pop/"/><title>Making progressive web apps even better: ambient badging and “pop into browser”</title><published>2016-06-21T00:00:00+00:00</published><updated>2016-06-21T00:00:00+00:00</updated><author><name>Andreas Bovens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<figure block="figure" mod="right">
	<img elem="media" src="/blog/pwa-badge-pop/picture.png" width="360" style="margin: 0 0 15px 15px" alt="Add to home screen badge in URL bar" />
</figure>

<p>We’re excited to release a <a href="https://www.opera.com/download/get/?partner=www&amp;product=android&amp;level=Labs">Labs build of Opera</a> for Android with support for two experimental features that enhance the discoverability and use of progressive web apps.</p>

<h2 id="ambient-badging">Ambient badging</h2>

<p>Earlier this month, <a href="https://infrequently.org/2016/06/pwa-discovery-you-aint-seen-nothin-yet/">Alex Russell wrote</a>:</p>

<blockquote>
  <p>Wouldn’t it be great if there were a button in the URL bar that appeared whenever you landed on a PWA that you could always tap to save it to your homescreen?</p>
</blockquote>

<p>We have been exploring this idea for a while, and are previewing an early version of this idea in this Labs build.</p>

<p>If you load a site that passes the criteria to qualify as a progressive web app, a small phone icon is shown to the left of the URL bar, labeling it as such. Note that this is different from the <a href="https://dev.opera.com/blog/web-app-install-banners/">“add to home screen” install banner</a>, which requires a user engagement check.</p>

<p>Give it a spin on one of the sites listed on <a href="https://pwa.rocks/">pwa.rocks</a> and <a href="https://twitter.com/odevrel/">let us know</a> how it goes.</p>

<h2 id="pop-into-browser">Pop into browser</h2>

<figure block="figure" mod="right">
	<video elem="media" controls="" cover="/blog/pwa-badge-pop/video.jpg" width="360" style="margin: 0 0 15px 15px">
		<source src="/blog/pwa-badge-pop/video.mp4" type="video/mp4" />
		<source src="/blog/pwa-badge-pop/video.webm" type="video/webm" />
	</video>
</figure>

<p>A few weeks ago, there were <a href="https://adactio.com/journal/10708">some discussions</a> around the lack of visibility of URLs in progressive web apps. What to do for instance if you want to find out the URL of a page inside a progressive web app?</p>

<p><a href="https://twitter.com/adactio/status/734875747169501185">Jeremy Keith tweeted</a>:</p>

<blockquote>
  <p>I want people to be able to copy URLs. I want people to be able to hack URLs. I’m not ashamed of my URLs …I’m downright proud.</p>
</blockquote>

<p>Also here, we’ve been doing some explorations: initially, we thought we could surface the URL by requiring the user to long-press anywhere in the web app and <a href="http://www.brucelawson.co.uk/2016/on-urls-in-progressive-web-apps/">show it in a context menu</a>. However, after further investigations, this turned out to be harder than expected — e.g. what to do with form fields, where context menus serve a different purpose? Then we had the idea to somehow connect it to the “pull-to-refresh” spinner, as a secondary gesture to the left or right. You can see in the video how this works. Quite useful, and it’s discoverable, without getting in the way.</p>

<p>These are just early proposals, and we may or may not include them in a final Opera for Android build. In the meanwhile, we’re happy to hear your feedback: give it a spin and <a href="https://twitter.com/odevrel/">let us know</a> what you think.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-38/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-38/"/><title>What’s new in Chromium 51 and Opera 38</title><published>2016-06-08T00:00:00+00:00</published><updated>2016-06-08T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 38 (based on Chromium 51) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/">Desktop</a> blog. Here’s what it means for web developers.</p>

<h2 id="es6-symbolhasinstance">ES6 <code>Symbol.hasInstance</code></h2>

<p>Constructors can now implement their own <code>Symbol.hasInstance</code> method, which is used by <code>instanceof</code> to determine whether a constructor object recognizes an object as its instance.</p>

<h2 id="es6-subclassing-using-symbolspecies">ES6 subclassing using <code>Symbol.species</code></h2>

<p><a href="https://tc39.github.io/ecma262/#sec-symbol.species">The <code>Symbol.species</code> accessor property</a> allows subclasses to <a href="https://tc39.github.io/ecma262/#sec-speciesconstructor">override</a> the default constructor for objects.</p>

<p>For example, <code>Array.prototype.map</code> constructs instances of the subclass as its return value, with the option to customize this by changing <code>Symbol.species</code>.</p>

<pre><code>class MyArray extends Array {
	static get [Symbol.species]() {
		// Return the parent `Array` constructor.
		return Array;
	}
}
const foo = new MyArray(1, 2, 3);
console.log(foo instanceof MyArray); // true
console.log(foo instanceof Array);   // true
const mapped = foo.map(x =&gt; x * x);
console.log(mapped instanceof MyArray); // false
console.log(mapped instanceof Array);   // true
</code></pre>

<h2 id="es6-regexp-subclassing">ES6 <code>RegExp</code> subclassing</h2>

<p>Previous versions of the JavaScript spec always used the original value of <code>RegExp.prototype.exec</code> in other methods such as <code>String.prototype.replace</code> — there was no way to override <code>exec</code> programmatically to change the core matching algorithm. In ES6 this is finally possible, which enables subclassing <code>RegExp</code> without having to duplicate any higher-level integration logic:</p>

<pre><code>class MyRegExp extends RegExp {
	exec() {
		return ['Hello from MyRegExp!'];
	}
}

const re = new MyRegExp('foo');
'bar'.match(re);
// ['Hello from MyRegExp!']
</code></pre>

<h2 id="es6-functionprototypename">ES6 <code>Function.prototype.name</code></h2>

<p>In ES6, the <code>name</code> property is sometimes set even on anonymous functions, based on the syntactic position of the function or class expression.</p>

<pre><code>const foo = function() {};
const bar = () =&gt; {};
console.log(foo.name); // 'foo'
console.log(bar.name); // 'bar'
</code></pre>

<h2 id="es6-iterator-closing">ES6 iterator closing</h2>

<p>Iterators are now checked for a <code>close</code> method which is called if the loop terminates early. This can be used for clean-up duty after the iteration has finished.</p>

<h2 id="es6-arrayprototypevalues">ES6 <code>Array.prototype.values</code></h2>

<p><a href="https://tc39.github.io/ecma262/#sec-array.prototype.values">The <code>values</code> method for arrays</a> returns an iterator over the contents of the array. This is similar to <code>Map.prototype.values</code> for maps or <code>Set.prototype.values</code> for sets.</p>

<h2 id="iterable-array-like-dom-interfaces">Iterable array-like DOM interfaces</h2>

<p>Any DOM interfaces containing indexed property getters and <code>length</code> properties now have a <code>Symbol.iterator</code> that makes them <a href="https://heycam.github.io/webidl/#es-iterators">iterable</a>. This means that things like <code>NodeList</code>, <code>HTMLAllCollection</code>, <code>FileList</code>, or <code>MediaList</code> can now be looped over by using <code>forEach</code> or <code>for-of</code>.</p>

<pre><code>for (const element of document.querySelectorAll('p')) {
	element.textContent += ' Hurray!';
}
</code></pre>

<h2 id="passive-event-listeners">Passive event listeners</h2>

<p>Passive event listeners are a new feature <a href="https://dom.spec.whatwg.org/#dom-eventlisteneroptions-passive">in the DOM spec</a> that enable developers to opt-in to better scroll performance by eliminating the need for scrolling to block on touch and wheel event listeners. Developers can annotate touch and wheel listeners with <code>{ passive: true }</code> to indicate that they don’t invoke <code>preventDefault</code> to get a massive scroll performance boost.</p>

<p>For more information, read <a href="https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md">the explainer document</a> or <a href="https://rbyers.github.io/scroll-latency.html">check out the demo</a>.</p>

<h2 id="keyboardeventprototypekey"><code>KeyboardEvent.prototype.key</code></h2>

<p><a href="https://w3c.github.io/uievents/#events-keyboard-key-location">The <code>key</code> property on <code>KeyboardEvent</code> instances</a> is now implemented. It returns the string value of the key (or keys) pressed by the user to generate the event. Check out <a href="https://googlechrome.github.io/samples/keyboardevent-key-attribute/">the demo for <code>key</code> specifically</a> or play around with <a href="https://w3c.github.io/uievents/tools/key-event-viewer.html">the keyboard event viewer</a>.</p>

<h2 id="intersection-observer-api">Intersection Observer API</h2>

<p>The brand-new <a href="https://wicg.github.io/IntersectionObserver/">Intersection Observer API</a> makes it easy to efficiently track when a given element in the DOM enters the visible viewport or leaves it. For more information, check out <a href="https://developers.google.com/web/updates/2016/04/intersectionobserver">Surma’s write-up</a> or <a href="https://github.com/WICG/IntersectionObserver/blob/gh-pages/explainer.md">the explainer document</a>, or <a href="https://wilsonpage.github.io/in-sixty/intersection-observer/">view a demo</a>.</p>

<h2 id="presentation-api">Presentation API</h2>

<p><a href="https://w3c.github.io/presentation-api/">The Presentation API</a> enables accessing external presentation-type displays and using them for presenting web content. <a href="https://storage.googleapis.com/presentation-api/index.html">A demo is available.</a></p>

<h2 id="service-workers-extendablemessageevent">Service workers: <code>ExtendableMessageEvent</code></h2>

<p><code>ServiceWorker.prototype.postMessage()</code> now results in an <a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#extendablemessage-event-section"><code>ExtendableMessageEvent</code></a> fired on <code>ServiceWorkerGlobalScope</code> as a <code>'message'</code> event. Before this change, <code>postMessage()</code> resulted in a <code>MessageEvent</code> fired on the global scope.</p>

<p>Calling <a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html#extendable-event-waituntil-method">the <code>waitUntil(promise)</code> method</a> of an <code>ExtendableMessageEvent</code> instance extends its lifetime until <code>promise</code> is settled.</p>

<p>To experiment with this, view <a href="https://googlechrome.github.io/samples/service-worker/post-message/">the service worker <code>postMessage()</code> demo</a>.</p>

<h2 id="web-audio-api-offlineaudiocontextprototypelength">Web Audio API: <code>OfflineAudioContext.prototype.length</code></h2>

<p><a href="https://webaudio.github.io/web-audio-api/#idl-def-OfflineAudioContext"><code>OfflineAudioContext</code></a> instances now have a <code>length</code> that indicates the number of frames that the offline context will render.</p>

<h2 id="webrtc-promise-based-rtcpeerconnection-methods">WebRTC: promise-based <code>RTCPeerConnection</code> methods</h2>

<p>The following <code>RTCPeerConnection</code> methods are now promise-based, matching <a href="https://w3c.github.io/webrtc-pc/">the updated spec</a>:</p>

<ul>
  <li><a href="https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addicecandidate"><code>addIceCandidate</code></a></li>
  <li><a href="https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createanswer"><code>createAnswer</code></a></li>
  <li><a href="https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-createoffer"><code>createOffer</code></a></li>
  <li><a href="https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setlocaldescription!overload-1"><code>setLocalDescription</code></a></li>
  <li><a href="https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-setremotedescription!overload-1"><code>setRemoteDescription</code></a></li>
</ul>

<h2 id="css-border-image-now-follows-the-spec">CSS <code>border-image</code> now follows the spec</h2>

<p>Chrome and Opera now require a border style in order to paint <code>border-image</code>s, matching <a href="https://www.w3.org/TR/css3-background/#the-border-image">the spec</a>. If you’re affected by this change, add e.g. <code>border-style: solid</code> where <code>border-image</code> is used.</p>

<h2 id="percentage-sizes-of-flex-item-children">Percentage sizes of flex item children</h2>

<p>According to the spec, certain flex items have <a href="https://drafts.csswg.org/css-flexbox/#definite-sizes">definite sizes</a>. If a child element of such a flex item uses percentage-based sizes, these are now handled correctly. <a href="http://jsbin.com/zefuxiviso/2/edit?html,output">A visual demo is available.</a></p>

<h2 id="samesite-cookie-attribute"><code>SameSite</code> cookie attribute</h2>

<p>The <a href="https://tools.ietf.org/html/draft-west-first-party-cookies-07">cookie attribute</a> formerly known as “First-Party-Only” or “First-Party” allows servers to mitigate the risk of <a href="https://www.owasp.org/index.php/Cross-Site_Request_Forgery_%28CSRF%29">CSRF</a> and information leakage attacks by asserting that a particular cookie should only be sent with requests initiated from the same domain.</p>

<h2 id="aes256gcm-for-tls"><code>AES_256_GCM</code> for TLS</h2>

<p>To simplify server configuration and negotiate modern ciphers with more existing servers, Chrome and Opera now offer the <code>AES_256_GCM</code> cipher suite for TLS connections. See <a href="https://groups.google.com/a/chromium.org/d/msg/blink-dev/5BmCy4Gx3gs/ShdUGrLqAQAJ">the intent to implement</a> for details.</p>

<h2 id="deprecated-and-removed-features">Deprecated and removed features</h2>

<p>For security reasons, custom messages in <code>onbeforeunload</code> dialogs are <a href="https://groups.google.com/a/chromium.org/d/msg/blink-dev/YIH8CoYVGSg/Di7TsljXDQAJ">no longer used</a>.</p>

<p>DHE-based TLS ciphers are now deprecated and support for them will be removed at some point in the future. A warning message is logged to the DevTools console whenever such a cipher is used. Servers should upgrade to ECDHE ciphers instead.</p>

<p>Chromium 51 / Opera 38 no longer negotiates SPDY over HTTPS connections. Sites using it return to negotiating HTTP/1.1, unless they upgrade to HTTP/2. <a href="https://blog.chromium.org/2016/02/transitioning-from-spdy-to-http2.html">Use HTTP/2 instead.</a></p>

<p>A related feature removal is that of NPN, which was the TLS extension used to negotiate SPDY. During the standardization process, NPN was replaced with <a href="https://tools.ietf.org/html/rfc7301">ALPN</a>.</p>

<p>The non-standard <code>results</code> attribute for <code>&lt;input type=search&gt;</code> is now deprecated. In Chrome and Opera, it’s a purely cosmetic feature that adds a magnifier icon to the input field. In desktop Safari, it controls <a href="https://developer.apple.com/library/iad/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/Attributes.html#//apple_ref/doc/uid/TP40008058-results">how many submitted queries are shown</a> in a popup opened by clicking the magnifier icon.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-37/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-37/"/><title>What’s new in Chromium 50 and Opera 37</title><published>2016-05-04T00:00:00+00:00</published><updated>2016-05-04T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 37 (based on Chromium 50) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/">Desktop</a> blog. Here’s what it means for web developers.</p>

<h2 id="es6-regexp-unicode-flag">ES6: <code>RegExp</code> Unicode flag</h2>

<p>ES6 specifies the <code>u</code> flag which enables more Unicode-friendly features and behavior in regular expressions. For example, it allows using astral symbols in character class ranges:</p>

<pre><code>// Match any symbol from U+1F4A9 PILE OF POO to U+1F4AB DIZZY SYMBOL.
const regex = /[💩-💫]/u; // Or, `/[\u{1F4A9}-\u{1F4AB}]/u`.
console.log(
	regex.test('💨'), // false
	regex.test('💩'), // true
	regex.test('💪'), // true
	regex.test('💫'), // true
	regex.test('💬')  // false
);
</code></pre>

<p>For more information on the effects of the <code>u</code> flag, see <a href="https://mathiasbynens.be/notes/es6-unicode-regex">“Unicode-aware regular expressions in ECMAScript 6”</a>.</p>

<h2 id="es6-more-well-known-symbols">ES6: more well-known symbols</h2>

<p>Five more <a href="https://tc39.github.io/ecma262/#sec-well-known-symbols">ECMAScript well-known symbols</a> have been implemented:</p>

<ul>
  <li><a href="https://tc39.github.io/ecma262/#sec-function.prototype-@@hasinstance"><code>Function.prototype[Symbol.hasInstance]</code></a>, used in <a href="https://tc39.github.io/ecma262/#sec-instanceofoperator">the <code>instanceof</code> operator</a>.</li>
  <li><a href="https://tc39.github.io/ecma262/#sec-regexp.prototype-@@match"><code>RegExp.prototype[Symbol.match]</code></a>, used to <a href="https://tc39.github.io/ecma262/#sec-isregexp">brand an object as <code>RegExp</code>-like</a>, and used in <a href="https://tc39.github.io/ecma262/#sec-string.prototype.match"><code>String.prototype.match</code></a>;</li>
  <li><a href="https://tc39.github.io/ecma262/#sec-regexp.prototype-@@replace"><code>RegExp.prototype[Symbol.replace]</code></a>, used in <a href="https://tc39.github.io/ecma262/#sec-string.prototype.replace"><code>String.prototype.replace</code></a>;</li>
  <li><a href="https://tc39.github.io/ecma262/#sec-regexp.prototype-@@search"><code>RegExp.prototype[Symbol.search]</code></a>, used in <a href="https://tc39.github.io/ecma262/#sec-string.prototype.search"><code>String.prototype.search</code></a>;</li>
  <li><a href="https://tc39.github.io/ecma262/#sec-regexp.prototype-@@split"><code>RegExp.prototype[Symbol.split]</code></a>, used in <a href="https://tc39.github.io/ecma262/#sec-string.prototype.split"><code>String.prototype.split</code></a>.</li>
</ul>

<p>These last four symbols act as hooks for <code>RegExp</code> subclasses to change the semantics of matching. By overriding <code>MyRegExpSubclass.prototype[Symbol.match]</code> etc. developers can change how the subclass behaves with respect to <code>String.prototype.match</code> and similar methods.</p>

<h2 id="bold-emoji-on-os-x">Bold emoji on OS X</h2>

<p>Previously, emoji with <code>font-weight: bold</code> applied to them failed to render in Chromium on OS X. This is now fixed. <strong>🙌🎉</strong></p>

<h2 id="link-relpreload-as"><code>&lt;link rel="preload" as="…"&gt;</code></h2>

<p><a href="https://w3c.github.io/preload/#link-type-preload">The <code>preload</code> link relation</a> makes it possible to define custom loading logic without suffering the performance penalty that script-based resource loaders incur. It can be combined with the <code>as</code> attribute to signal to the browser <a href="https://fetch.spec.whatwg.org/#concept-request-destination">what kind of resource</a> is being preloaded. This enables various optimizations that <code>&lt;link rel="prefetch"&gt;</code> or <code>preload</code>’s predecessor <code>&lt;link rel="subresource"&gt;</code> don’t offer. See <a href="https://www.smashingmagazine.com/2016/02/preload-what-is-it-good-for/">Yoav Weiss’ excellent article</a> for more information.</p>

<h2 id="css-column-fill">CSS <code>column-fill</code></h2>

<p>When using multi-column layouts, <a href="https://drafts.csswg.org/css-multicol-1/#cf">the CSS <code>column-fill</code> property</a> indicates whether columns should be balanced or not. If they are balanced, each column gets similar amounts of content inside. If they are not balanced, each column is filled to the height of the multicol container, until all the content is displayed. <a href="https://drafts.csswg.org/css-multicol-1/#cf">The spec</a> contains some examples with visualizations.</p>

<h2 id="canvas-updates">Canvas updates</h2>

<p><code>&lt;canvas&gt;</code> element instances now support <a href="https://html.spec.whatwg.org/multipage/scripting.html#dom-canvas-toblob">the <code>toBlob()</code> method</a> alongside the <code>toDataURL()</code> method. <code>toBlob()</code> is typically more efficient than <code>toDataURL</code>, as it enables you to work with the encoded binary data directly rather than with a Base64-encoded string.</p>

<p>The global <a href="https://html.spec.whatwg.org/multipage/webappapis.html#dom-createimagebitmap"><code>createImageBitmap()</code></a> method decodes an image in the background and returns an <a href="https://html.spec.whatwg.org/multipage/scripting.html#the-imagebitmap-rendering-context"><code>ImageBitmap</code></a> which you can draw onto a <code>&lt;canvas&gt;</code> in the same way you would an <code>&lt;img&gt;</code> element, another canvas, or a video. See <a href="https://developers.google.com/web/updates/2016/03/createimagebitmap-in-chrome-50">Paul Lewis’ write-up</a> for more details.</p>

<h2 id="domtokenlist-validation"><code>DOMTokenList</code> validation</h2>

<p>It’s now possible to programmatically detect support of values for HTML attributes that are backed by <code>DOMTokenList</code> instances in JavaScript. Currently, those HTML attributes are the following:</p>

<ul>
  <li><a href="https://html.spec.whatwg.org/multipage/semantics.html#attr-link-rel"><code>&lt;link rel&gt;</code> relations</a></li>
  <li><a href="https://html.spec.whatwg.org/multipage/embedded-content.html#attr-iframe-sandbox"><code>&lt;iframe sandbox&gt;</code> directives</a></li>
</ul>

<p>To test a value, just use <a href="https://dom.spec.whatwg.org/#dom-domtokenlist-supports"><code>.supports(value)</code></a> on the <code>DOMTokenList</code> instance. For more information, check out <a href="https://developers.google.com/web/updates/2016/03/domtokenlist-validation-added-in-chrome-50">the Google Developers blog post</a>.</p>

<h2 id="formdata-updates"><code>FormData</code> updates</h2>

<p><a href="https://xhr.spec.whatwg.org/#interface-formdata">The <code>FormData</code> interface</a> provides a way to easily construct a set of key/value pairs representing form fields and their values, which can then be easily sent using <code>XMLHttpRequest</code> or <code>fetch</code>. Previously, <code>FormData</code> objects had a single <code>append()</code> method, and were thus write-only. The spec has now added <code>has()</code>, <code>get()</code>, <code>getAll()</code>, <code>delete()</code>, <code>set()</code>, <code>entries()</code>, <code>keys()</code>, <code>values()</code>, <code>forEach()</code> and <code>Symbol.iterator()</code> methods to allow inspection, iteration, and modification. <a href="https://googlechrome.github.io/samples/formdata-methods/">Check out the demo.</a></p>

<h2 id="htmlmediaelementprototypeplay-returns-a-promise"><code>HTMLMediaElement.prototype.play()</code> returns a promise</h2>

<p><a href="https://html.spec.whatwg.org/multipage/embedded-content.html#dom-media-play">The <code>play</code> method</a> on <code>&lt;video&gt;</code> or <code>&lt;audio&gt;</code> element instances now returns a promise. If playback succeeds, the promise is fulfilled, and if playback fails, the promise is rejected along with an error message explaining the failure. For more details, check out <a href="https://developers.google.com/web/updates/2016/03/play-returns-promise">Jeff Posnick’s blog post</a> or <a href="https://googlechrome.github.io/samples/play-return-promise/">view the demo</a>.</p>

<h2 id="presentation-api-updates">Presentation API updates</h2>

<p>Support for the <code>statechange</code> event on <code>PresentationConnection</code> instances has been removed since it’s no longer part of <a href="https://w3c.github.io/presentation-api/#event-handlers-1">the spec</a>. On the other hand, the <code>message</code>, <code>connect</code>, <code>close</code>, and <code>terminate</code> event are now implemented.</p>

<h2 id="web-animations-api-updates">Web Animations API updates</h2>

<p>This release introduces the following Web Animations API changes to improve interoperability with other browsers and to improve spec compliance:</p>

<ul>
  <li><a href="https://w3c.github.io/web-animations/#the-animation-interface"><code>Animation.prototype.id</code></a></li>
  <li><code>cancel</code> events</li>
  <li>Deprecation of dashed names as keys in keyframes (to be removed in the next release)</li>
  <li>State change for the <code>pause()</code> method</li>
</ul>

<p>For details, see <a href="https://developers.google.com/web/updates/2016/03/web-animations-improvements">Alex Danilo’s write-up about these features</a>.</p>

<h2 id="web-audio-api-updates">Web Audio API updates</h2>

<p>Automations for the <a href="https://webaudio.github.io/web-audio-api/#the-biquadfilternode-interface"><code>BiquadFilter</code></a> node now run at a-rate (updated every frame) instead of at k-rate (updated every rendering quantum of 128 frames). This change matches the spec.</p>

<h2 id="push-notifications-on-opera-for-android">Push Notifications on Opera for Android</h2>

<p>Opera for Android now supports <a href="https://developers.google.com/web/fundamentals/getting-started/push-notifications/">push notifications</a>.</p>

<h2 id="sequential-focus-navigation-starting-point">Sequential focus navigation starting point</h2>

<p>The <a href="https://html.spec.whatwg.org/multipage/interaction.html#sequential-focus-navigation-starting-point">sequential focus navigation starting point</a> is how the HTML spec defines where browsers should start to search for focusable areas when pressing Tab or Shift+Tab while there is no focused area. This is now implemented according to the spec.</p>

<h2 id="x25519-for-tls">X25519 for TLS</h2>

<p>Chromium 50 brings support for X25519, the Diffie-Hellman primitive over <a href="https://tools.ietf.org/html/draft-ietf-tls-curve25519-01">Curve25519</a>, to TLS. When compared to P-256, the most commonly used curve in TLS today, it admits simpler, faster implementations that are more naturally resistant to side-channels. Servers may <a href="https://tlswg.github.io/tls13-spec/#rfc.section.6.3.2.2">negotiate</a> X25519 for ECDH instead of existing curves.</p>

<h2 id="deprecated-or-removed-features">Deprecated or removed features</h2>

<p>The Geolocation API <a href="https://developers.google.com/web/updates/2016/04/geolocation-on-secure-contexts-only">no longer works on insecure origins</a>. Use HTTPS instead.</p>

<p>The use of <a href="https://html.spec.whatwg.org/multipage/browsers.html#applicationcache">the application cache API</a> on insecure origins has been deprecated and will be removed in a future release. Use HTTPS and service workers instead.</p>

<p>Support for <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=583787">the insecure TLS fallback mechanism</a> has been removed. This does <em>not</em> remove support for older versions of TLS — it just prevents attackers from downgrading the connection to use outdated, insecure ciphers. If your server is affected by this change, it does not implement TLS correctly. Consider upgrading to TLS 1.2 — all ciphers in prior versions have known problems.</p>

<p><a href="https://svgwg.org/svg2-draft/single-page.html#script-InterfaceSVGZoomEvent">The SVG <code>zoom</code> event</a> was never fully implemented in Chromium, causing false positives in feature detection scripts. It has now been deprecated and its removal is planned for Chromium 52 / Opera 39.</p>

<p>Support for the non-standard <code>-webkit-background-composite</code> CSS property has been removed.</p>

<p>The WebRTC <code>RTCPeerConnection</code> instance methods <a href="https://w3c.github.io/webrtc-pc/#widl-RTCPeerConnection-createOffer-Promise-RTCSessionDescription--RTCOfferOptions-options"><code>createOffer()</code></a> and <a href="https://w3c.github.io/webrtc-pc/#widl-RTCPeerConnection-createAnswer-void-RTCSessionDescriptionCallback-successCallback-RTCPeerConnectionErrorCallback-failureCallback"><code>createAnswer()</code></a> now require an error handler as well as a success handler. Previously it was possible to call these methods with only a success handler. This non-standard behavior has been deprecated.</p>

<p>Support for <code>&lt;link rel="subresource"&gt;</code> has been removed. It never worked as intended, and no other browser engines implemented it. Use the <code>preconnect</code>, <code>prefetch</code>, <code>preload</code>, or <code>prerender</code> link relations instead, or use a service worker in combination with the Cache API for more fine-grained control.</p>

<p>The non-standard <code>KeyboardEvent.prototype.keyLocation</code> alias has been removed. To disambiguate between keys that are on multiple places on a keyboard, like numbers and Enter, use <a href="https://w3c.github.io/uievents/#events-keyboard-key-location"><code>KeyboardEvent.prototype.location</code></a> instead.</p>

<p>Support for <a href="https://github.com/whatwg/dom/issues/58#issuecomment-162481999"><code>document.defaultCharset</code></a> has been removed.</p>

<p><code>Object.observe()</code> has been <a href="https://esdiscuss.org/topic/an-update-on-object-observe">removed</a> from the ECMAScript spec and is now no longer supported in Chromium. Use the <code>Proxy</code> API to observe objects instead.</p>

<p>The <code>SVGElement</code> instance properties <code>offsetParent</code>, <code>offsetTop</code>, <code>offsetLeft</code>, <code>offsetWidth</code>, and <code>offsetHeight</code> has been removed. They are now only supported on <code>HTMLElement</code>s, matching the spec. If you need similar functionality for SVG elements, use <code>getBoundingClientRect()</code> instead.</p>

<p>The <code>XMLHttpRequestProgressEvent</code> interface has been removed, together with the <code>position</code> and <code>totalSize</code> properties. Use the <code>ProgressEvent</code> interface with the <code>loaded</code> and total <code>properties</code> instead.</p>

<p><a href="https://developers.google.com/web/updates/2016/03/chrome-50-deprecations">The Google Developers blog</a> has more details on some of these feature removals/deprecations.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/better-extensions-ecosystem/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/better-extensions-ecosystem/"/><title>For a Better Extensions Ecosystem</title><published>2016-05-03T00:00:00+00:00</published><updated>2016-05-03T00:00:00+00:00</updated><author><name>Shwetank Dixit</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>In 2013, when Opera desktop and Opera for Android switched over to Chromium, we faced a choice on how to go about our extensions ecosystem. We decided to look to the future and anticipated that someday developers might want to have a standardised way to make extensions (or at least, have a common set of APIs) so that the effort of making a separate extension for each browser is reduced.</p>

<p>That is why we chose our extension packaging format as <code>.nex</code> which stands for ‘navigator extensions’, signifying our take on a vendor-neutral format for extensions. Back it 2013, <a href="https://dev.opera.com/blog/introducing-nex/">we wrote the following</a>:</p>

<blockquote>
  <p>…NEX — a vendor-neutral packaging format for browser add-ons that we have initially implemented on top of the Chromium <code>.crx</code> format in Opera. We intend to further develop this as an open add-ons format through international standards bodies. Initially we intend to consolidate the differences between add-on execution environments themselves considering their current similarities. As a secondary objective we then aim to kick-start meaningful discussion around shared system and device-level APIs with a view to making browser add-ons first-class citizens of the web core.</p>
</blockquote>

<p>Years later, it seems a lot of other browser makers are also on board with getting some common extension APIs which work cross-browser. In order to do this, <a href="https://lists.w3.org/Archives/Public/public-browserext/2016May/0000.html">Opera, Microsoft, and Mozilla have begun work in the Extensions Community Group</a> where we will try to agree upon a set of common APIs, as well as a common manifest and packaging format for browser extensions. The goal is to enable extension developers to write one extension and have it work cross-browser.</p>

<p>This does not mean that browsers will not have their own proprietary APIs — they will, for some features. However, if we can work out a common manifest and packaging format, along with a core set of APIs to have in common, then this will go a long way in having interoperability of extensions across browsers. This could also open the door to a type of ‘progressive enhancement’ model for developing extensions (where instead of making a separate extension for each browser, we could make one extension and feature detect for various APIs), much like we have for web sites.</p>

<p>We appeal to the community to participate in the discussion in the group, and to give their feedback and ideas. We hope other browser makers will join us, so that together we can make extension development for multiple browsers much smoother than it is right now.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/timing-attacks/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/timing-attacks/"/><title>Front-End Performance: The Dark Side</title><published>2016-04-25T00:00:00+00:00</published><updated>2016-04-25T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>On April 1st, I spoke at the very first <a href="https://fronteers.nl/congres/2016-spring">Fronteers Spring Conference</a>. The theme of the whole conference was <strong>performance</strong>. For my presentation, I decided to try something a little bit different: instead of talking about techniques that lead to better client-side performance, I focused on security-sensitive situations in which performance can actually be a <em>bug</em> rather than a feature.</p>

<p>View <a href="https://speakerdeck.com/mathiasbynens/front-end-performance-the-dark-side-at-fronteers-spring-conference-2016">the slides</a> here:</p>

<figure block="figure">
	<iframe elem="media" src="https://speakerdeck.com/player/63fc31552bd24a5dbf3bf22f9454c35f" width="767" height="493" allowfullscreen=""></iframe>
</figure>

<p>Check out the video below.</p>

<figure block="figure">
	<iframe elem="media" src="https://player.vimeo.com/video/163113209" width="640" height="360" allowfullscreen=""></iframe>
</figure>

<p>The Q&amp;A session after the talk was recorded as well.</p>

<figure block="figure">
	<iframe elem="media" src="https://player.vimeo.com/video/163232535" width="640" height="360" allowfullscreen=""></iframe>
</figure>

<p>The presentation walks through what <em>timing attacks</em> are, explains how they can occur on the web through client-side code, and demonstrates how modern performance-related web APIs can sometimes have a negative security impact. To get the point across, I showcased some brilliant research by <a href="https://zyan.scripts.mit.edu/sniffly/">Yan Zhu</a> and <a href="https://tom.vg/academic/#ccs2015-timing">Tom Van Goethem</a>. My favorite demo was one of Tom’s, where a client-side timing attack (using nothing but JavaScript) is used to figure out the exact age of the current visitor. (This demo starts around 16:03 in the first video.)</p>

<p>To me, this stuff is extremely interesting on a technical level. It’s also a little scary, however, to realize that malicious actors can use these techniques to invade your privacy while you’re browsing the web, without you ever knowing. Embedded third-party advertisements could be running timing attacks in the background, leaking pieces of private info (such as age, gender, location), which in turn enables them to serve you more targeted advertisements, fingerprint and track you across the web, or even de-anonymize you completely.</p>

<p>The sad news is that, as a web developer, there’s no obvious way to prevent this type of attack. Using <a href="http://www.sjoerdlangkemper.nl/2016/04/14/preventing-csrf-with-samesite-cookie-attribute/"><code>Same-Site</code> cookies</a> helps, but its <code>strict</code> mode seems a bit too aggressive for mainstream usage, and its <code>lax</code> mode might still not fully protect against timing attacks.</p>

<p>End users should consider <a href="opera://settings/?search=third-party%20cookies">blocking third-party cookies</a>, or using a content blocker (not just an ad blocker) in their browser.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/web-app-install-banners/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/web-app-install-banners/"/><title>Progressive Web App install banners come to Opera for Android</title><published>2016-03-31T00:00:00+00:00</published><updated>2016-03-31T00:00:00+00:00</updated><author><name>Andreas Bovens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<figure block="figure" mod="right">
	<img elem="media" src="/blog/web-app-install-banners/pd-1-banner.png" width="360" style="margin: 0 0 15px 15px" alt="PD-1 web app install banner" />
</figure>

<p>Since we first shipped support for web manifest and “add to home screen” in Opera 32 for Android <a href="https://dev.opera.com/articles/installable-web-apps/">last year</a>, we’ve seen an increasing amount of interest in progressive web apps.</p>

<p>Here at Opera, we’re excited about progressive web apps’ potential to bring the web on par with native apps’ capabilities, and this while avoiding the whole app store submission process — indeed, web apps can be discovered in a low friction way on the web, and changes can be pushed instantly to all users, while preserving their privacy with a conservative ask-when-needed permissions model. Additionally, from our initial observations, it seems like web apps are especially suited for devices with limited storage space, which is great news. If you haven’t seen it yet, I recommend reading <a href="https://developers.google.com/web/showcase/case-study/flipkart">Flipkart’s interesting report</a> about the boost in conversions and re-engagements they experienced after launching their <a href="https://m.flipkart.com/">Flipkart Lite</a> web app back in November 2015.</p>

<p>However, one hurdle with our implementation thus far has been that, in order for progressive web apps to appear like native apps on the home screen, users have to tap the + sign, and pick “Add to home screen” by themselves, and that can be quite a roadblock.</p>

<p>That’s why in Opera 36, we’ve started showing a “progressive web app install banner” for sites that meet a set of criteria, qualifying them as a progressive web app. These criteria are as follows. The site must:</p>

<ul>
  <li>Be served over HTTPS</li>
  <li>Have a manifest with a <code>short_name</code> and <code>name</code>, <code>start_url</code>, and a PNG icon of at least 144×144 pixels</li>
  <li>Have a service worker (making sure that the <code>start_url</code> functions offline)</li>
</ul>

<p>In addition, we also have a user engagement condition, so as to not show the install banner too aggressively. The condition there is that: the user has visited your site at least twice, with 5 minutes or more between visits. Careful readers will notice these conditions are the same as in <a href="https://developers.google.com/web/updates/2015/03/increasing-engagement-with-app-install-banners-in-chrome-for-android?hl=en">Chrome</a>, but we may change this in the future.</p>

<p>If you want to try this out without waiting between visits, simply go to <code>opera:flags</code>, enable “Bypass user engagement checks” and restart the browser. If you then visit a site like <a href="https://alexgibson.github.io/wavepad/">WAVE-PD1</a>, you’ll get prompted right away to add the web app in question to your home screen.</p>

<p>It’s also worth noting that in some cases, you may want to cancel the install banner from being shown. You can do this by intercepting the <code>onbeforeinstallprompt</code> event and preventing default on the event. You can see this in action on <a href="https://m.flipkart.com/">Flipkart Lite</a>. When you load their site (with “Bypass user engagement checks” enabled), you’ll feel a vibration and a small icon animation in the top right corner, suggesting to “Install this webapp to your phone”. If the user taps this icon, Opera’s own install banner is shown, which the user is likely to accept; if she does not tap the icon, Flipkart can remind her one of the next times, whenever it seems convenient to do so. This is of course somewhat more complex to implement, but it offers more possibilities to re-engage the user at the right point in time, later on.</p>

<p>That’s it! Try it out with the apps listed on our <a href="https://operasoftware.github.io/pwa-list/">Progressive Web Apps</a> list, and let us know how it goes!</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/pwa-taipei/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/pwa-taipei/"/><title>Progressive Web Apps: the future of Apps</title><published>2016-03-30T00:00:00+00:00</published><updated>2016-03-30T00:00:00+00:00</updated><author><name>Bruce Lawson</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>On 26 March, I gave a presentation at iWeb Summit 2016 in Taipei about Progressive Web Apps. Here’s the 20 minute video.</p>

<figure block="figure">
	<iframe elem="media" width="420" height="315" src="https://www.youtube.com/embed/MSldc28Hvp0" allowfullscreen=""></iframe>
</figure>

<p>If you don’t like my voice, just <a href="http://www.slideshare.net/brucelawson/bruce-lawson-progressive-web-apps-the-future-of-apps">see the slides</a>.</p>

<h2 id="more-resources">More resources</h2>

<ul>
  <li><a href="https://medium.com/net-magazine/html-manifest-402e6a8cc0e9#.kyg4r82s2">Non-technical guide to HTML Manifest</a> that I wrote for .net magazine</li>
  <li><a href="http://brucelawson.github.io/manifest/">Manifest generator</a></li>
  <li><a href="https://developers.google.com/web/showcase/case-study/flipkart?hl=en">New Progressive Web App helps Flipkart boost conversions 70%</a> and other business benefits of PWAs.</li>
  <li><a href="/articles/installable-web-apps/">Installable Web Apps and Add to Home screen</a>: a longer tutorial on how to make a Progressive Web App.</li>
  <li><a href="https://dev.opera.com/blog/web-app-install-banners/">Progressive Web App install banners come to Opera for Android</a></li>
  <li><a href="https://pwa.rocks/">List of good Progressive Web Apps</a></li>
</ul>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-36/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-36/"/><title>What’s new in Chromium 49 and Opera 36</title><published>2016-03-15T00:00:00+00:00</published><updated>2016-03-15T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 36 (based on Chromium 49) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> and <a href="https://play.google.com/store/apps/details?id=com.opera.browser">Android</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/">Desktop</a> and <a href="http://www.opera.com/blogs/mobile/2016/03/brand-new-tab-switcher-web-app-discovery-opera-36-android/">Mobile</a> blogs. Here’s what it means for web developers.</p>

<h2 id="es6-default-function-parameter-values">ES6 default function parameter values</h2>

<p>ES6 allows formal parameters to be <a href="https://tc39.github.io/ecma262/#sec-functions-and-classes">initialized with default values</a> if no value (or <code>undefined</code>) is passed.</p>

<pre><code>function fn(x, y = 0) {
	return [x, y];
}
</code></pre>

<p>In this example, omitting the second parameter triggers the default value:</p>

<pre><code>console.log(fn(1));
// → [1, 0]
console.log(fn());
// → [undefined, 0]
</code></pre>

<p>For more information, see <a href="http://www.2ality.com/2015/01/es6-destructuring.html#parameter_handling">“Parameter handling in ES6”</a> or <a href="https://googlechrome.github.io/samples/default-parameters-es6/">check out the demo</a>.</p>

<h2 id="es6-destructuring-assignment">ES6 destructuring assignment</h2>

<p><a href="https://tc39.github.io/ecma262/#sec-destructuring-assignment">Destructuring assignment</a> makes it possible to extract data from arrays or objects using a syntax that mirrors the construction of array and object literals.</p>

<pre><code>let a, b, rest;
[a, b] = [1, 2];
// → a = 1; b = 2
[a, b, ...rest] = [1, 2, 3, 4, 5];
// → a = 1; b = 2; rest = [3, 4, 5]
{a, b} = { a: 1, b: 2 };
// → a = 1; b = 2
</code></pre>

<p><a href="https://googlechrome.github.io/samples/destructuring-es6/">Check out the demo for more examples.</a></p>

<h2 id="es6-proxy-and-reflect">ES6 <code>Proxy</code> and <code>Reflect</code></h2>

<p><a href="https://tc39.github.io/ecma262/#sec-proxy-object-internal-methods-and-internal-slots"><code>Proxy</code> objects</a> can be used to define custom behavior for fundamental operations such as property lookup, assignment, enumeration, function invocation, etc.</p>

<p><a href="https://tc39.github.io/ecma262/#sec-reflection">The <code>Reflect</code> API</a> offers imperative methods for invoking, examining or modifying values at runtime, and is very useful for working with Proxies.</p>

<p>Read <a href="https://developers.google.com/web/updates/2016/02/es2015-proxies">“ES2015 proxies”</a> for more information on both <code>Proxy</code> and <code>Reflect</code>.</p>

<h2 id="es6-block-scoped-bindings-in-sloppy-mode">ES6 block-scoped bindings in sloppy mode</h2>

<p><code>const</code>, <code>let</code>, <code>class</code>, and <code>function</code> now follow the proper ES6 semantics even in sloppy (i.e. non-strict) mode.</p>

<h2 id="symboltostringtag"><code>Symbol.toStringTag</code></h2>

<p>Using <a href="https://tc39.github.io/ecma262/#sec-symbol.tostringtag"><code>Symbol.toStringTag</code></a>, user-defined types can return customized output when passed to <code>Object.prototype.toString</code> (either directly or as a result of string coercion) by storing a descriptive string in a <code>Symbol.toStringTag</code>-keyed property.</p>

<pre><code>const object = {};
object[Symbol.toStringTag] = 'yoloswag';
String(object);
// → '[object yoloswag]'
</code></pre>

<h2 id="promise-rejection-events">Promise rejection events</h2>

<p>Two new global events, <code>unhandledrejection</code> and <code>rejectionhandled</code>, can be used to keep track of <code>Promise</code> rejections, including whether those rejections are handled after the fact.</p>

<p><a href="https://googlechrome.github.io/samples/promise-rejection-events/">See the demo for more information.</a></p>

<h2 id="css-custom-properties-css-variables">CSS Custom Properties (CSS Variables)</h2>

<p><a href="https://drafts.csswg.org/css-variables/">The CSS Variables spec</a> defines a new primitive value type that is accepted by all CSS properties, as well as custom properties for defining them. As with other CSS values, they can be updated programmatically using JavaScript. See <a href="https://developers.google.com/web/updates/2016/02/css-variables-why-should-you-care">“CSS Variables: why should you care?”</a> for more info. <a href="https://googlechrome.github.io/samples/css-custom-properties/">A demo is available.</a></p>

<h2 id="case-insensitive-attribute-value-selectors">Case-insensitive attribute value selectors</h2>

<p>In HTML, the attribute <em>values</em> of <a href="https://html.spec.whatwg.org/multipage/scripting.html#case-sensitivity">certain attributes are compared ASCII-case-insensitively</a>.</p>

<p>Consider the following CSS:</p>

<pre><code>/* Every paragraph whose ID starts with `note` (case-sensitively) gets a lime background. */
p[id^="note"] {
	background-color: lime;
}
/* Every paragraph whose `lang` is `no` (ASCII-case-insensitively, in HTML) get underlined */
p[lang="no"] {
	text-decoration: underline;
}
</code></pre>

<p>And the following markup:</p>

<pre><code>&lt;p id="note-1" lang="no"&gt;1&lt;/p&gt;
&lt;p id="nOtE-2" lang="No"&gt;2&lt;/p&gt;
&lt;p id="NOTE-3" lang="NO"&gt;3&lt;/p&gt;
</code></pre>

<p>In HTML and XML/<a href="https://mathiasbynens.be/notes/xhtml5">XHTML</a>, only the first paragraph gets a green background. In HTML, all paragraphs are underlined, but in XML/XHTML only the first is underlined.</p>

<p>Luckily, the <code>i</code> identifier can now be used in CSS selectors to opt-in to case-insensitive matching for attribute values, regardless of document language rules. With the <code>i</code> flag, all three paragraphs are highlighted and underlined in HTML and XML/XHTML environments:</p>

<pre><code>/* Every paragraph whose ID starts with `note` (ASCII-case-insensitively) gets a lime background. */
p[id^="note" i] {
	background-color: lime;
}
/* Every paragraph whose `lang` is `no` (ASCII-case-insensitively) get underlined */
p[lang="no" i] {
	text-decoration: underline;
}
</code></pre>

<p>Note that the <code>i</code> flag only affects the case of matching the attribute <em>value</em>; not the attribute <em>name</em> or anything else.</p>

<h2 id="web-audio-api-updates">Web Audio API updates</h2>

<p>The Web Audio API defines <a href="https://webaudio.github.io/web-audio-api/#the-iirfilternode-interface"><code>IIRFilterNode</code></a>, which is an <code>AudioNode</code> processor implementing a general IIR filter. Once created, the coefficients of the IIR filter cannot be changed, and no automation functions are allowed.</p>

<p>Additionally, Chromium now supports <code>suspend()</code> and <code>resume()</code> methods on <code>OfflineAudioContext</code> instances.</p>

<p><a href="https://webaudio.github.io/web-audio-api/#widl-BaseAudioContext-decodeAudioData-Promise-AudioBuffer--ArrayBuffer-audioData-DecodeSuccessCallback-successCallback-DecodeErrorCallback-errorCallback"><code>AudioContext.prototype.decodeAudioData</code></a> now returns a <code>Promise&lt;AudioBuffer&gt;</code> that is resolved when decoding the audio data is finished. This is in addition to the existing callbacks, which are now optional.</p>

<h2 id="service-worker-windowclientprototypenavigate">Service worker: <code>WindowClient.prototype.navigate()</code></h2>

<p>It is now possible to trigger navigation from a service worker using <a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#client-navigate-method">the <code>navigate()</code> method on a <code>WindowClient</code> instance</a>. <a href="https://googlechrome.github.io/samples/service-worker/windowclient-navigate/">Check out the demo.</a></p>

<h2 id="audio-output-devices-api">Audio Output Devices API</h2>

<p><a href="https://w3c.github.io/mediacapture-output/">The Audio Output Devices API specification</a> defines a set of JavaScript APIs that let a web app manage how audio is rendered on the user’s audio output devices. With this feature it’s now possible for web apps to send audio to authorized output devices other than the system default. <a href="https://webrtc.github.io/samples/src/content/devices/multi/">A demo is available.</a></p>

<h2 id="fetch-api-updates">Fetch API updates</h2>

<p>The <code>'navigate'</code> <a href="https://fetch.spec.whatwg.org/#concept-request-mode">request mode</a> as defined in the Fetch API specification is now supported. Check out <a href="https://googlechrome.github.io/samples/service-worker/custom-offline-page/">the “custom offline page” service worker demo</a> where this is being used.</p>

<p>Additionally, <a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#fetch-event-clientid"><code>FetchEvent.prototype.clientId</code></a> is now implemented. This read-only property returns the ID of the <code>Client</code> that the current service worker is controlling. The <code>Clients.get()</code> method can then be passed this ID to retrieve the associated client.</p>

<h2 id="htmlmediaelementprototypedisableremoteplayback"><code>HTMLMediaElement.prototype.disableRemotePlayback</code></h2>

<p><a href="https://w3c.github.io/remote-playback/">The Remote Playback API specification</a> defines a <code>disableRemotePlayback</code> setter on <code>HTMLMediaElement</code> instances, which can be used to signal to the browser that this media element should not be played remotely. Enabling <code>disableRemotePlayback</code> by setting it to <code>true</code> causes the browser to not show any UI advertising remote playback, and prevents the element from being played remotely.</p>

<h2 id="high-resolution-event-time-stamps">High-resolution event time stamps</h2>

<p><a href="https://dom.spec.whatwg.org/#dom-event-timestamp"><code>Event.prototype.timeStamp</code></a> indicates the time at which a given event took place. Previously, this <code>timeStamp</code> value was represented as a <code>DOMTimeStamp</code>, which was a whole number of milliseconds since the system epoch.</p>

<p>Starting with Chromium 49, <code>timeStamp</code> is a <code>DOMHighResTimeStamp</code> value. This value is still a number of milliseconds, but with <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=506723#c8">a resolution of 5 microseconds</a>, meaning the value now includes a decimal component. Additionally, instead of the value being relative to the epoch, the value is relative to <code>performance.timing.navigationStart</code>, i.e. the time at which the user navigated to the page. (<a href="https://github.com/whatwg/dom/issues/23">We’re working on getting this into the spec.</a>)</p>

<p>To convert a <code>DOMHighResTimeStamp</code> value to an absolute number of milliseconds since the epoch (e.g., to get a value to pass to the <code>Date()</code> constructor), use <code>performance.timing.navigationStart + event.timeStamp</code>.</p>

<p><a href="https://googlechrome.github.io/samples/event-timestamp/">A demo is available.</a></p>

<h2 id="urlsearchparams"><code>URLSearchParams</code></h2>

<p><a href="https://url.spec.whatwg.org/#interface-urlsearchparams">The <code>URLSearchParams</code> API</a> defines helper methods for working with the query string of a URL (i.e. everything after <code>?</code>). <a href="https://googlechrome.github.io/samples/urlsearchparams/">A demo is available.</a></p>

<h2 id="a-relnoopener"><code>&lt;a rel=noopener&gt;</code></h2>

<p>You may be familiar with <a href="https://html.spec.whatwg.org/multipage/semantics.html#link-type-noreferrer"><code>&lt;a rel=noreferrer&gt;</code></a>, which prevents sending the <code>Referer</code> HTTP header and sets <code>window.opener</code> to <code>null</code> when following a link.</p>

<p>If you only want to disable <code>window.opener</code> but still send the <code>Referer</code> header, you can now use <a href="https://html.spec.whatwg.org/multipage/semantics.html#link-type-noopener"><code>rel=noopener</code></a>. Note that this is only needed for links that open a new navigation context, i.e. <code>target="_blank"</code>.</p>

<p>Why would you want to do this? Well, if <code>window.opener</code> is set, a page can trigger a navigation in the opener regardless of origin, which is a potential security risk. <a href="https://mathiasbynens.github.io/rel-noopener/">Check out the demo for a more elaborate explanation.</a></p>

<h2 id="cookie-prefixes">Cookie Prefixes</h2>

<p><a href="https://tools.ietf.org/html/draft-ietf-httpbis-cookie-prefixes-00">Cookie Prefixes</a> are a way of “smuggling” information in the name prefix of a cookie to ensure that certain attributes accompany the request to set a cookie. Chromium now supports the following cookie prefixes:</p>

<ul>
  <li><code>__Secure-</code>, which signals to the browser that the <code>Secure</code> attribute is required.</li>
  <li><code>__Host-</code>, which signals to the browser that both the <code>Path=/</code> and <code>Secure</code> attributes are required, and at the same time, that the <code>Domain</code> attribute must not be present.</li>
</ul>

<p><a href="https://googlechrome.github.io/samples/cookie-prefixes/">Check out the demo for more information.</a>.</p>

<h2 id="improved-handling-of-insecure-source-expressions-in-csp">Improved handling of insecure source expressions in CSP</h2>

<p><a href="https://zyan.scripts.mit.edu/sniffly/">Sniffly</a> is a timing attack to sniff browser history. One of its variants was based on a clever trick combining CSP and HSTS. In response, <a href="https://w3c.github.io/webappsec-csp/#changes-from-level-2">the CSP matching algorithm was updated</a> to make insecure schemes in source expressions match their secure variants. That is, <code>http:</code> is now equivalent to <code>http: https:</code>, and <code>http://example.com</code> to <code>http://example.com https://example.com</code>. Likewise, <code>'self'</code> now matches <code>https</code> and <code>wss</code> variants of the page’s origin, even on pages whose scheme is <code>http</code>.</p>

<h2 id="faster-and-more-secure-https-connections">Faster and more secure HTTPS connections</h2>

<p>The standardized versions of <a href="https://tools.ietf.org/html/rfc7539">the ChaCha20 stream cipher and Poly1305 authenticator</a> are now <a href="https://tools.ietf.org/html/draft-ietf-tls-chacha20-poly1305-04">used for TLS connections</a> in Chromium. Compared to <a href="https://tools.ietf.org/html/rfc5288">AES-GCM</a>, this new TLS cipher suite is <a href="https://security.googleblog.com/2014/04/speeding-up-and-strengthening-https.html">more secure</a>, saves network bandwidth, and operates three times faster on devices that lack AES hardware acceleration such as most Android devices.</p>

<h2 id="geolocation-now-https-only">Geolocation now HTTPS-only</h2>

<p>The <a href="https://w3c.github.io/webappsec-secure-contexts/#legacy-example">Secure Contexts specification</a> lists the Geolocation API as an example of an API that should only be available over secure contexts such as HTTPS. As of Chromium 49, the Geolocation API won’t work over insecure contexts anymore. If you need to use Geolocation, use HTTPS.</p>

<h2 id="smooth-scrolling">Smooth scrolling</h2>

<p>As of Chromium 49, <a href="https://developers.google.com/web/updates/2016/02/smooth-scrolling-in-chrome-49">scrolling is getting smoother</a> on Windows and Linux. But that’s not all: there are more potential improvements that may land soon, through Houdini and CSS properties like <code>scroll-behavior: smooth</code>. (On OS X, <a href="https://bugs.chromium.org/p/chromium/issues/detail?id=574283">nothing has changed yet</a>; smooth scrolling was already enabled, but only for keyboard-triggered scrolls.)</p>

<p>If you were using a JS library to implement smooth scrolling, now is a good time to stop using them. Scrolling in JavaScript has worse performance than native smooth scrolling, and <a href="https://plus.google.com/+RickByers/posts/RdYaYF5DTF4">old versions of SmoothScroll.js will stop scrolling entirely</a> in the future when <a href="https://dev.opera.com/articles/fixing-the-scrolltop-bug/">the <code>scrollTop</code> bug</a> is fixed.</p>

<h2 id="deprecated-or-removed-features">Deprecated or removed features</h2>

<p>Support for the <a href="https://w3c.github.io/pointerlock/">Pointer Lock API</a>’s prefixed event properties <code>MouseEvent.prototype.webkitMovementX</code> and <code>MouseEvent.prototype.webkitMovementY</code> has been removed. Use the standardized versions, i.e. <code>MouseEvent.prototype.movementX</code> and <code>MouseEvent.prototype.movementY</code>, instead.</p>

<p>Support for <a href="https://html.spec.whatwg.org/multipage/forms.html#the-keygen-element">the <code>&lt;keygen&gt;</code> HTML element</a> has been removed. See the <a href="https://groups.google.com/a/chromium.org/d/msg/blink-dev/pX5NbX0Xack/kmHsyMGJZAMJ">intent to deprecate mail</a> for some background on this decision.</p>

<p>The non-standard <code>TouchEvent.prototype.initTouchEvent</code> is now deprecated. Use <a href="https://dev.opera.com/blog/opera-35/#touch-and-touchevent-constructors">the <code>Touch</code> and <code>TouchEvent</code> constructors</a> instead.</p>

<p>The non-standard <code>navigator.getStorageUpdates()</code> has been removed. It <a href="https://groups.google.com/a/chromium.org/d/msg/blink-dev/ak1kVjiX9T4/mo1rqcyQAQAJ">used to be a no-op</a> anyway.</p>

<p>The presence of <code>getComputedStyle(element).css*</code> (except for <code>.cssFloat</code>) is non-standard behavior, so support for it has been removed. Use <code>getComputedStyle(element).*</code> instead.</p>

<p>Previously, Chromium treated the first two arguments (<code>type</code> and <code>listener</code>) of <code>addEventListener</code> and <code>removeEventListener</code> as optional, while they are non-optional in the spec and in other browsers. <a href="https://googlechrome.github.io/samples/event-listeners-mandatory-arguments/">This has changed</a>: calling these methods with zero or one argument now throws an exception.</p>

<p><code>document.defaultCharset</code> <a href="https://github.com/whatwg/dom/issues/58#issuecomment-162933700">has been deprecated</a> and will be removed in a future release.</p>

<p><code>Object.observe</code> has been deprecated as it is <a href="https://esdiscuss.org/topic/an-update-on-object-observe">no longer on the standardization track</a> and will be removed in a future release.</p>

<p>The WebRTC <code>RTCPeerConnection</code> methods <a href="https://w3c.github.io/webrtc-pc/#widl-RTCPeerConnection-createOffer-Promise-RTCSessionDescription--RTCOfferOptions-options"><code>createOffer()</code></a> and <a href="https://w3c.github.io/webrtc-pc/#widl-RTCPeerConnection-createAnswer-Promise-RTCSessionDescription--RTCAnswerOptions-options"><code>createAnswer()</code></a> now require an error handler as well as a success handler, matching the spec. Previously it was possible to call these methods with only a success handler. That usage is deprecated. This change paves the way for introducing promises on these methods, as required by the WebRTC spec.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-35/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-35/"/><title>Opera 35 released</title><published>2016-02-02T00:00:00+00:00</published><updated>2016-02-02T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 35 (based on Chromium 48) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> and <a href="https://play.google.com/store/apps/details?id=com.opera.browser">Android</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/">Desktop</a> and <a href="https://www.opera.com/blogs/mobile/2016/02/save-space-on-your-android-phone-with-web-apps/">Mobile</a> blogs. Here’s what it means for web developers.</p>

<h2 id="es6-more-well-known-symbols">ES6: more well-known symbols</h2>

<p>Two more <a href="https://tc39.github.io/ecma262/#sec-well-known-symbols">well-known symbols</a> have been implemented:</p>

<ul>
  <li><code>Symbol.isConcatSpreadable</code> points to a boolean value that indicates if an object should be flattened to its array elements by <code>Array.prototype.concat</code> (<code>true</code>) or not (<code>false</code>).</li>
  <li><code>Symbol.toPrimitive</code> points to a method that converts an object to a corresponding primitive value.</li>
</ul>

<h2 id="css-improved-auto">CSS: improved <code>auto</code></h2>

<p>The <a href="https://drafts.csswg.org/css-flexbox/#min-size-auto">implied minimum size of a flex item</a> (i.e. <code>min-width: auto</code> or <code>min-height: auto</code>) is now also computed correctly when <code>flex-basis</code> is not <code>auto</code>.</p>

<h2 id="css-writing-modes-updates">CSS Writing Modes updates</h2>

<p>The CSS properties <a href="https://drafts.csswg.org/css-writing-modes-3/#text-combine-upright"><code>text-combine-upright</code></a>, <a href="https://drafts.csswg.org/css-writing-modes-3/#text-orientation"><code>text-orientation</code></a>, and <a href="https://drafts.csswg.org/css-writing-modes-3/#block-flow"><code>writing-mode</code></a> are now available without the <code>-webkit-</code> prefix, and with new syntax matching the spec.</p>

<p>The <code>isolate</code>, <code>isolate-override</code>, and <code>plaintext</code> values for <a href="https://drafts.csswg.org/css-writing-modes-3/#unicode-bidi">the <code>unicode-bidi</code> CSS property</a> can now be used without the <code>-webkit-</code> prefix. Support for the non-standard <code>horizontal-bt</code> value (as in <code>-webkit-writing-mode: horizontal-bt</code>) has been removed.</p>

<h2 id="unprefixed-css-font-feature-settings">Unprefixed CSS <code>font-feature-settings</code></h2>

<p><a href="https://drafts.csswg.org/css-fonts/#font-feature-settings-prop">The CSS <code>font-feature-settings</code> property</a> now works without the <code>-webkit-</code> prefix. This property provides low-level control over <a href="https://dev.opera.com/articles/state-of-web-type/#opentype-features">OpenType font features</a>.</p>

<p>The <code>-webkit-</code>-prefixed version is now deprecated and will be removed in a future release.</p>

<h2 id="css-font-loading-api-improvements">CSS Font Loading API improvements</h2>

<p>Our implementation of the <code>FontFaceSet</code> interface (e.g. <code>document.fonts</code>) is now set-like, <a href="https://drafts.csswg.org/css-font-loading/#FontFaceSet-interface">matching the spec</a>. This means it has <code>entries()</code>, <code>keys()</code>, and <code>values()</code> iterators, and is itself an iterator (over the individual <code>FontFace</code> entries).</p>

<p>Also, the <code>add()</code> and <code>remove()</code> methods don’t throw <code>InvalidModificationError</code> anymore when adding or deleting a CSS-connected font-face to the same <code>FontFaceSet</code>. Here’s an example of that:</p>

<pre><code>&lt;style&gt;
	@font-face {
		font-family: Test;
		src: local('Helvetica');
	}
&lt;/style&gt;
&lt;script&gt;
	var face;
	document.fonts.forEach(function(f) { face = f; });
	document.fonts.add(face);    // no-op
	document.fonts.remove(face); // no-op, returns `false`
&lt;/script&gt;
</code></pre>

<p>Previously, the above <code>add()</code> and <code>remove()</code> both threw <code>InvalidModificationError</code> exceptions.</p>

<p><a href="https://googlechrome.github.io/samples/font-face-set/">A demo is available.</a></p>

<h2 id="fetch-api-data-and-blob-url-scheme-support">Fetch API: <code>data:</code> and <code>blob:</code> URL scheme support</h2>

<p>Our <a href="https://fetch.spec.whatwg.org/">Fetch API</a> implementation now supports the <code>data:</code> and <code>blob:</code> URL schemes.</p>

<h2 id="indexeddb-api-additions">IndexedDB API additions</h2>

<p>The IndexedDB <code>getAll()</code> and <code>getAllKeys()</code> methods are now supported on the <a href="https://w3c.github.io/IndexedDB/#object-store"><code>IDBObjectStore</code></a> and <a href="https://w3c.github.io/IndexedDB/#index"><code>IDBIndex</code></a> interfaces. Additionally, <a href="https://w3c.github.io/IndexedDB/#dom-idbobjectstore-openkeycursor"><code>IDBObjectStore.prototype.openKeyCursor()</code></a> and <a href="https://w3c.github.io/IndexedDB/#dom-idbtransaction-objectstorenames"><code>IDBTransaction.prototype.objectStoreNames</code></a> have been implemented.</p>

<p><a href="https://googlechrome.github.io/samples/idb-getall/">A demo is available.</a></p>

<h2 id="mediastreamtrackprototyperemote"><code>MediaStreamTrack.prototype.remote</code></h2>

<p><a href="https://w3c.github.io/mediacapture-main/getusermedia.html#widl-MediaStreamTrack-remote">The <code>remote</code> property</a> on WebRTC <code>MediaStreamTrack</code> instances is now available. It can be used to determine whether a stream track is from a remote source or a local one.</p>

<h2 id="serviceworkerregistrationprototypeupdate-more-spec-compliant"><code>ServiceWorkerRegistration.prototype.update()</code> more spec-compliant</h2>

<p><a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-registration-update">The <code>update</code> method on <code>ServiceWorkerRegistration</code> instances</a> used to always bypass the browser cache. Now, it only bypasses the browser cache if the previous update check occurred over 24 hours ago.</p>

<h2 id="touch-and-touchevent-constructors"><code>Touch</code> and <code>TouchEvent</code> constructors</h2>

<p>The <a href="https://w3c.github.io/touch-events/#touch-interface"><code>Touch</code></a> and <a href="https://w3c.github.io/touch-events/#touchevent-interface"><code>TouchEvent</code></a> constructors make it easy to programmatically create <code>Touch</code> and <code>TouchEvent</code> instances from an object literal.</p>

<pre><code>const t = new Touch({
	'identifier': 42,
	'target': document.body,
	'clientX': 200,
	'clientY': 200,
	'screenX': 300,
	'screenY': 300,
	'pageX': 250,
	'pageY': 250,
	'radiusX': 2.5,
	'radiusY': 2.5,
	'rotationAngle': 10,
	'force': 0.5
});
</code></pre>

<p>A <a href="https://output.jsbin.com/lohuwa">demo with more examples</a> is available.</p>

<h2 id="keyboardeventprototypecode"><code>KeyboardEvent.prototype.code</code></h2>

<p><a href="https://w3c.github.io/uievents/#widl-KeyboardEvent-code">The <code>code</code> property on <code>KeyboardEvent</code> instances</a> is now implemented. The value of this property identifies the physical key that generated the keyboard event, regardless of the user’s current keyboard layout. For example, the physical <code>Q</code> key represents the symbol <code>q</code> on a QWERTY keyboard layout, but represents <code>a</code> on an AZERTY keyboard layout — but its <code>.code</code> value is <code>'KeyQ'</code> in both configurations.</p>

<p><a href="https://googlechrome.github.io/samples/keyboardevent-code-attribute/">A demo is available.</a></p>

<h2 id="web-audio-api-connect-chaining">Web Audio API: <code>.connect()</code> chaining</h2>

<p>The <code>connect</code> method on <code>AudioNode</code> and <code>AudioParam</code> instances now supports chaining, <a href="https://webaudio.github.io/web-audio-api/#widl-AudioNode-connect-AudioNode-AudioNode-destination-unsigned-long-output-unsigned-long-input">as per the spec</a>.</p>

<p>Before this change, you’d write code like this:</p>

<pre><code>sourceNode.connect(gainNode);
sourceNode.connect(filterNode);
sourceNode.connect(destination);
</code></pre>

<p>Now that can be simplified as follows:</p>

<pre><code>sourceNode
	.connect(gainNode)
	.connect(filterNode)
	.connect(destination);
</code></pre>

<p><a href="https://googlechrome.github.io/samples/webaudio-method-chaining/">A demo is available.</a></p>

<h2 id="deprecated-and-removed-features">Deprecated and removed features</h2>

<p>Support for the non-standard CSS values <code>intrinsic</code> and <code>min-intrinsic</code> has been removed. Use the standardized values <a href="https://drafts.csswg.org/css-sizing-3/#max-content"><code>max-content</code></a> and <a href="https://drafts.csswg.org/css-sizing-3/#min-content"><code>min-content</code></a> instead.</p>

<p>Support for CSS <code>composite-mode: darker</code> has been removed since <code>darker</code> is a non-<a href="https://drafts.fxtf.org/compositing-1/#compositemode">standard</a> value.</p>

<p>The <code>glyph-orientation-horizontal</code> and <code>glyph-orientation-vertical</code> CSS properties for SVG elements have been removed. Use <a href="https://drafts.csswg.org/css-writing-modes-3/#text-orientation"><code>text-orientation</code></a> instead, just like you would for HTML elements.</p>

<p>The <code>offsetParent</code>, <code>offsetTop</code>, <code>offsetLeft</code>, <code>offsetWidth</code>, and <code>offsetHeight</code> properties on <code>SVGElement</code> instances are now deprecated and will be removed in an upcoming release. Per the spec, <a href="https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface">these properties should only exist on <code>HTMLElement</code>s</a>. For <code>SVGElement</code>s, you can use <code>getBoundingClientRect()</code> instead.</p>

<p>The <code>getTransformToElement</code> method on <code>SVGGraphicsElement</code> instances has been removed, <a href="https://html.spec.whatwg.org/multipage/embedded-content.html#svg-0">matching the spec</a>.</p>

<p>The <code>SVGPathSeg</code> and <code>SVGPathSegList</code> constructors have been removed. They were part of the old SVG 1.1 spec, but have since been removed from the standard. If you rely on these APIs, you’ll be pleased to hear that <a href="https://github.com/progers/pathseg">a polyfill is available for them</a>.</p>

<p>The <code>getSVGDocument</code> method is no longer available on <code>HTMLFrameElement</code> instances. We now match the spec, which makes this method available on <code>HTMLEmbedElement</code>, <code>HTMLIFrameElement</code>, and <code>HTMLObjectElement</code> instances only.</p>

<p>The non-standard <code>item()</code> method on <a href="https://html.spec.whatwg.org/#texttracklist"><code>TextTrackList</code></a> and <a href="https://html.spec.whatwg.org/#texttrackcuelist"><code>TextTrackCueList</code></a> has been removed. Use <code>tracks[index]</code> instead of <code>tracks.item(index)</code>.</p>

<p>Following the recommendation in <a href="https://tools.ietf.org/html/rfc7465" title="Prohibiting RC4 Cipher Suites">RFC 7465</a>, support for the RC4 cipher has finally been removed. HTTPS connections that rely on RC4 exclusively <a href="https://en.wikipedia.org/wiki/RC4#Security">cannot be considered secure anymore</a> and will therefore fail from now on.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/cssconf-jsconf-asia/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/cssconf-jsconf-asia/"/><title>CSSConf.asia &amp; JSConf.asia</title><published>2016-01-07T00:00:00+00:00</published><updated>2016-01-07T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>In November 2015, my colleague <a href="https://twitter.com/p01">Mathieu</a> and I visited Singapore to attend <a href="http://2015.cssconf.asia/">CSSConf.asia</a> and <a href="http://2015.jsconf.asia/">JSConf.asia</a>. Here’s a summary of our presentations.</p>

<h2 id="making-real-time-audio-visual-demos">Making real-time audio-visual demos</h2>

<p>At JSConf.asia, Mathieu spoke about creative coding, bringing the <a href="https://en.wikipedia.org/wiki/Demoscene">demoscene</a> to the web, and crazy JavaScript optimization tricks. He then proceeded to code an audio-visual demo from scratch, live on stage, using nothing but web standards.</p>

<figure block="figure">
	<iframe elem="media" width="560" height="315" src="https://www.youtube.com/embed/16oLi1kvLHs" allowfullscreen=""></iframe>
</figure>

<h2 id="random-css-fun-facts">Random CSS fun facts</h2>

<p>I had the pleasure of presenting at CSSConf.asia, and used that opportunity to showcase a series of obscure CSS fun facts, such as CSS syntax gimmicks and quirks, weird tricks that involve CSS in one way or another, and security vulnerabilities that are enabled by (ab)using CSS in unexpected ways.</p>

<figure block="figure">
	<iframe elem="media" width="560" height="315" src="https://www.youtube.com/embed/KPL-mA77bDo" allowfullscreen=""></iframe>
</figure>

<p>In case you’re into that kind of stuff, there’s some terrible CSS puns at the end. (<a href="https://twitter.com/search?q=cssbandnames">#cssbandnames</a>, anyone?)</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-34/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-34/"/><title>Opera 34 released</title><published>2015-12-08T00:00:00+00:00</published><updated>2015-12-08T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 34 (based on Chromium 47) for <a href="https://www.opera.com/computer">Mac, Windows, and Linux</a> and <a href="https://www.opera.com/mobile/operabrowser/android">Android</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/2015/12/opera-34-technology-help/">Desktop</a> and <a href="https://www.opera.com/blogs/mobile/2015/12/force-enable-zoom-opera-34-for-android/">Mobile</a> blogs. Here’s what it means for web developers.</p>

<h2 id="arrayprototypeincludes"><code>Array.prototype.includes</code></h2>

<p>ES2016 (previously known as “ES7”) features <a href="https://tc39.github.io/Array.prototype.includes/">a new array method named <code>includes</code></a> that determines whether an array includes a given element.</p>

<pre><code>// Good ol’ ES5:
var isIncluded = someArray.indexOf(element) != -1;
// Shiny new ES2016:
const isIncluded = someArray.includes(element);
</code></pre>

<p>Compared to the old-school <code>indexOf</code> approach, <code>includes</code> handles <code>NaN</code> more elegantly:</p>

<pre><code>var array = [NaN];
array.indexOf(NaN) != -1;
// → false
array.includes(NaN);
// → true
</code></pre>

<p><code>includes</code> is also available for <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays#Typed_array_views">typed arrays</a> such as <code>Int16Array</code> or <code>Float64Array</code>.</p>

<h2 id="es6-rest-parameters">ES6 rest parameters</h2>

<p>The <a href="https://tc39.github.io/ecma262/#sec-function-definitions">ES6 rest parameters syntax</a> allows functions to have a variable number of arguments without using the <code>arguments</code> object. Unlike <code>arguments</code>, the rest argument is a proper array, meaning array methods can be called on it directly:</p>

<pre><code>// ES5:
function sort() {
	var sortedArgs = [].sort.call(arguments);
	return sortedArgs;
}

sort('z', 'y', 'x', 'a', 'c', 'b');
// → 'a', 'b', 'c', 'x', 'y', 'z'

// ES6:
function sort(...args) {
	var sortedArgs = args.sort();
	return sortedArgs;
}

sort('z', 'y', 'x', 'a', 'c', 'b');
// → 'a', 'b', 'c', 'x', 'y', 'z'
</code></pre>

<h2 id="navigatormediadevices"><code>navigator.mediaDevices</code></h2>

<p>The new <code>navigator.mediaDevices</code> API can be used to enumerate connected media devices and to retrieve their media streams. We recommend the following:</p>

<ul>
  <li>Use <code>navigator.mediaDevices.enumerateDevices()</code> instead of the non-standard  <code>MediaStreamTrack.getSources()</code> which doesn’t support audio output devices.</li>
  <li>Use <code>navigator.mediaDevices.getUserMedia()</code> instead of <code>navigator.getUserMedia()</code>.</li>
</ul>

<p>More info can be found <a href="https://developers.google.com/web/updates/2015/10/media-devices">on the Google Developers blog</a>, and hey — <a href="https://webrtc.github.io/samples/src/content/devices/input-output/">here’s a demo</a>.</p>

<h2 id="mouseeventprototypegetmodifierstate"><code>MouseEvent.prototype.getModifierState</code></h2>

<p>We now support <a href="https://w3c.github.io/uievents/#widl-MouseEvent-getModifierState">the <code>getModifierState</code> method on <code>MouseEvent</code> instances</a>. It returns information about which modifier keys were pressed at the time the event was fired. Previously, this method was only available on <code>KeyboardEvent</code> instances. This change matches the spec and makes these APIs more consistent. <a href="https://googlechrome.github.io/samples/mouseevent-get-modifier-state/">A demo is available.</a></p>

<h2 id="requestidlecallback"><code>requestIdleCallback</code></h2>

<p><a href="https://w3c.github.io/requestidlecallback/">The new <code>requestIdleCallback</code> API</a> allows scheduling a task to run when the browser is idle. This makes it possible to perform background work on the main event loop, without impacting latency-critical events such as animation and input response.</p>

<p>For more information, check out <a href="https://developers.google.com/web/updates/2015/08/using-requestidlecallback">the excellent tutorial on the Google Developers blog</a>.</p>

<h2 id="inputdevicecapabilities"><code>InputDeviceCapabilities</code></h2>

<p><a href="https://rbyers.github.io/InputDevice/">The new <code>InputDeviceCapabilities</code> API</a> provides details about the physical device responsible for generating an event. <code>InputDeviceCapabilities.prototype.firesTouchEvents</code> returns whether this device dispatches touch events. All types of <code>UIEvent</code> now have their own <code>sourceCapabilities</code> property which returns the <code>InputDeviceCapabilities</code> associated with the physical device responsible for them.</p>

<h2 id="fetch-api-requestinitreferrer">Fetch API: <code>RequestInit.referrer</code></h2>

<p><a href="https://github.com/google/Chrome.Docs/blob/master/m47/Request_Constructor_Additions.md">This feature</a> allows requests captured by service workers to match the original referrer.</p>

<p>By default, a captured request gets the service worker’s referrer (i.e. the service worker’s script URL), but with this feature the request keeps the original referrer.</p>

<h2 id="updated-default-fetch-api-request-flags-for-service-workers">Updated default Fetch API request flags for service workers</h2>

<p>The flags of request objects that are passed to the service worker’s Fetch Event handler for navigation requests have been changed. Previously, these were the defaults for <code>mode</code>, <code>credentials</code>, and <code>redirect</code>:</p>

<pre><code>{
	'mode': 'no-cors',
	'credentials': 'same-origin'
	'redirect': 'follow'
}
</code></pre>

<p>The new defaults (matching the spec) are:</p>

<pre><code>{
	'mode': 'same-origin',
	'credentials': 'include'
	'redirect': 'manual'
}
</code></pre>

<h2 id="cache-api-matchall">Cache API: <code>matchAll</code></h2>

<p><a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-matchall"><code>Cache.prototype.matchAll</code></a> is now supported. It greatly simplifies bulk searching of the cache, and <a href="https://developers.google.com/web/updates/2015/09/updates-to-cache-api#cachematchall-coming-to-chrome-47">allows you to get multiple matches</a>.</p>

<h2 id="removed-features">Removed features</h2>

<p><a href="http://www.w3.org/TR/SVG11/types.html#InterfaceSVGTests">The SVG 1.1 <code>hasExtension()</code> methods</a> on <code>SVGAnimationElement</code>, <code>SVGCursorElement</code>, <code>SVGGraphicsElement</code>, <code>SVGMaskElement</code>, and <code>SVGPatternElement</code> have been <a href="http://www.w3.org/TR/SVG2/types.html#InterfaceSVGTests">removed in SVG 2</a>. Now, they’re removed from Opera and Chrome as well. Don’t worry — these methods always returned <code>false</code> and were thus of no real use anyway.</p>

<p>The same goes for <a href="http://www.w3.org/TR/SVG11/struct.html#InterfaceSVGSVGElement">a few SVG 1.1 SVG element methods</a> — <a href="http://www.w3.org/TR/SVG2/struct.html#InterfaceSVGSVGElement">they no longer exist in SVG 2</a>. So long, <code>pixelUnitToMillimeterX</code>, <code>pixelUnitToMillimeterY</code>, <code>screenPixelToMillimeterX</code>, and <code>screenPixelToMillimeterY</code>, and thanks for all the pixels! (These properties didn’t do what their names suggested in the first place — all they did was return the constant <code>0.2645833194255829</code>.)</p>

<h2 id="improved-text-selection">Improved text selection</h2>

<p>Chromium no longer highlights the gaps between content when painting selections.</p>

<figure block="figure">
	<img elem="media" src="/blog/opera-34/selection.png" width="388" alt="" />
	<figcaption elem="caption">The new, much cleaner, text selection behavior. <a href="/blog/opera-34/selection.jpg">A before/after comparison is available, too.</a></figcaption>
</figure>

<h2 id="more-extension-apis">More extension APIs</h2>

<p>Opera 34 adds support for <a href="https://developer.chrome.com/extensions/desktopCapture">the <code>chrome.desktopCapture</code> API</a>, enabling extensions with screensharing capabilities.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/progressive-web-apps-future/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/progressive-web-apps-future/"/><title>Progressive Web Apps Are the Future</title><published>2015-11-19T00:00:00+00:00</published><updated>2015-11-19T00:00:00+00:00</updated><author><name>Andreas Bovens, Vadim Makeev</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>The two-day Chrome Dev Summit at Google’s headquarters in Mountain View is a wrap! Vadim and I had a great time attending the summit, and this year, I even had the pleasure to share the stage with Alex Russell (thank you!) to speak about Progressive Web Apps, and specifically web manifests, which we’ve <a href="https://dev.opera.com/articles/installable-web-apps/">recently shipped</a> support for in Opera for Android. (Since this was first published, <a href="https://blog.mozilla.org/futurereleases/2015/11/17/extending-the-webs-capabilities-in-firefox-and-beyond/">Firefox announced plans</a> to support Progressive Web Apps, too!)</p>

<p>You can check out the full video of our talk below:</p>

<figure block="figure">
	<iframe elem="media" width="560" height="315" src="https://www.youtube.com/embed/MyQ8mtR9WxI" allowfullscreen=""></iframe>
</figure>

<p>“Progressive Web Apps” is an umbrella term for modern, performant web apps that cleverly take advantage of technologies like web manifest, push notifications, service worker, responsive web design, etc. to provide a top-tier experience on mobile.</p>

<p>The latest high-profile “progressive web app” example is of course the recently launched <a href="http://stories.flipkart.com/introducing-flipkart-lite/">Flipkart Lite website</a>, which was presented in a dedicated session at the summit.</p>

<p>And if you’re into little web games, also try adding this <a href="https://andreasbovens.github.io/inbox-attack/">Inbox Attack</a> demo to your home screen: it will lock to vertical orientation, and in Opera, the game will go full screen. I’ve even added vibration events to the buttons to make it more realistic :)</p>

<p>Here at Opera, we’re super excited about Progressive Web Apps and the role they will play in bridging the gap between web and native. We’re hard at work to further add installation prompting in Opera for Android, and support for push notifications and more is in the pipeline. Stay tuned, and if you’re curious to learn more, check out the <a href="https://www.youtube.com/playlist?list=PLNYkxOF6rcICcHeQY02XLvoGL34rZFWZn">other videos from the summit</a>. We want your site to be a progressive web  as well!</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-33/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-33/"/><title>Opera 33 released</title><published>2015-10-27T00:00:00+00:00</published><updated>2015-10-27T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 33 (based on Chromium 46) for <a href="https://www.opera.com/computer">Mac, Windows, and Linux</a> and <a href="https://www.opera.com/mobile/operabrowser/android">Android</a> is out! To find out what’s new for users, see our <a href="http://blogs.opera.com/news/2015/10/the-new-o-has-landed-on-opera-for-computers/">Desktop</a> and <a href="https://www.opera.com/blogs/mobile/2015/11/video-compression-now-in-opera-for-android/">Mobile</a> blogs. Here’s what it means for web developers.</p>

<h2 id="link-relpreconnect"><code>&lt;link rel=preconnect&gt;</code></h2>

<p><a href="https://w3c.github.io/resource-hints/">The Resource Hints standard</a> defines <code>&lt;link rel="preconnect" href="…"&gt;</code> as a hint that the browser should predictively open a connection to the supplied server for resources that will be needed later in the loading process.</p>

<h2 id="iframe-sandboxallow-popups-to-escape-sandbox"><code>&lt;iframe sandbox="allow-popups-to-escape-sandbox"&gt;</code></h2>

<p><a href="https://html.spec.whatwg.org/multipage/browsers.html#attr-iframe-sandbox-allow-popups-to-escape-sandbox">The <code>allow-popups-to-escape-sandbox</code> flag</a> for <code>&lt;iframe sandbox="…"&gt;</code> allows a sandboxed document to spawn new windows without forcing the sandboxing flags upon them, hence creating a clean browsing context. For example, a third-party advertisement can be safely sandboxed without forcing the same restrictions upon a landing page. <a href="https://googlechrome.github.io/samples/allow-popups-to-escape-sandbox/">A demo is available.</a></p>

<h2 id="iframe-sandboxallow-scripts-allow-modals"><code>&lt;iframe sandbox="allow-scripts allow-modals"&gt;</code></h2>

<p>From now on, sandboxed frames block modal dialogs (such as those caused by <code>window.alert()</code>, <code>window.confirm()</code>, <code>window.print()</code>, and <code>window.prompt()</code>) by default to prevent them from popping up confusing messages to users.</p>

<p>If you really want to allow modal dialogs inside a sandboxed frame, add <a href="https://html.spec.whatwg.org/multipage/browsers.html#attr-iframe-sandbox-allow-modals"><code>allow-modals</code></a> to its <code>sandbox</code> attribute. <a href="https://googlechrome.github.io/samples/block-modal-dialogs-sandboxed-iframe/">A demo is available.</a></p>

<h2 id="es6-newtarget">ES6 <code>new.target</code></h2>

<p><a href="https://tc39.github.io/ecma262/#sec-meta-properties-runtime-semantics-evaluation"><code>new.target</code></a> is an implicit parameter that all functions have. It is to constructor calls as <code>this</code> is to method calls:</p>

<ul>
  <li>Inside of a constructor, <code>new.target</code> is a reference to the constructor that was used when calling <code>new</code>.</li>
  <li>Inside of a normal function, <code>new.target</code> is <code>undefined</code>.</li>
</ul>

<p>This is useful for distinguishing at runtime whether code is being executed as a constructor or as a function. <code>new.target</code> may also be used as a way to determine the specific subclass that was used with <code>new</code> from within a superclass constructor. <a href="https://googlechrome.github.io/samples/new-target-es6/">A demo is available.</a></p>

<h2 id="es6-spread-operator">ES6 spread operator</h2>

<p>The ES6 spread operator <code>...</code> turns the elements of an array into the arguments of a function call or into elements of another array.</p>

<pre><code>// Date of the Opera 33 release.
new Date(...[2015, 9, 20]);

// Or…
const dateParts = [2015, 9, 20];
new Date(...dateParts);
</code></pre>

<p>For more information, read <a href="http://www.2ality.com/2015/01/es6-destructuring.html#the_spread_operator_%28...%29">Axel Rauschmayer’s explanation of the spread operator</a>.</p>

<h2 id="new-domexceptionmessage-errorname"><code>new DOMException(message, errorName)</code></h2>

<p><a href="https://heycam.github.io/webidl/#dfn-DOMException"><code>DOMException</code></a>s can now be programmatically created as follows:</p>

<pre><code>throw new DOMException('The operation could not be completed', 'AbortError');
</code></pre>

<p>The first parameter is a custom error message; the second parameter is a value taken from <a href="https://heycam.github.io/webidl/#idl-DOMException-error-names">the table of <code>DOMException</code> error names</a>.</p>

<h2 id="trusted-events">Trusted events</h2>

<p><a href="https://dom.spec.whatwg.org/#dom-event-istrusted">The <code>isTrusted</code> read-only property</a> of an <code>Event</code> instance is <code>true</code> when the event was generated by a user action such as mouse click, and <code>false</code> when the event was scripted or invoked via <code>dispatchEvent</code>.</p>

<p>This is primarily useful for browser extensions, to determine if an event was dispatched by a script running in the main world or not.</p>

<p><a href="https://googlechrome.github.io/samples/event-istrusted/">A demo is available.</a></p>

<h2 id="historyscrollrestoration"><code>history.scrollRestoration</code></h2>

<p>By default, browsers restore the scroll position when a user traverses history.
This behavior works well for document-style web sites but it is often not
appropriate for single-page web applications where the page content may be
reconstructed (often asynchronously) upon navigation and where the
application wants to control the details of visual transition between UI states.</p>

<p><a href="https://majido.github.io/scroll-restoration-proposal/history-based-api.html">The new <code>history.scrollRestoration</code> API</a> makes it possible to disable this default scroll restoration behavior, as follows:</p>

<pre><code>history.scrollRestoration = 'manual';
</code></pre>

<p>This leaves the web developer in full control over any scroll changes that may be required when a user traverses the app’s history.</p>

<p>For more details, see <a href="https://developers.google.com/web/updates/2015/09/history-api-scroll-restoration">Paul Lewis’ blog post</a>.</p>

<h2 id="webrtc-bufferedamountlow-event">WebRTC <code>bufferedamountlow</code> event</h2>

<p><a href="https://w3c.github.io/webrtc-pc/#event-datachannel-bufferedamountlow">The <code>bufferedamountlow</code> event</a> makes it possible to monitor WebRTC data channel buffers. This allows pages to use WebRTC data channels for high-throughput applications more efficiently and conveniently, by removing the need to use timer-based polling for output buffer management.</p>

<h2 id="cssescapestring"><code>CSS.escape(string)</code></h2>

<p><a href="https://drafts.csswg.org/cssom/#the-css.escape%28%29-method"><code>CSS.escape(string)</code></a> serializes <code>string</code> as a CSS identifier. This enables developers to easily and securely do things like escaping a string for use as part of a selector. <a href="https://googlechrome.github.io/samples/css-escape/">Check out the demo</a>, and <a href="https://github.com/mathiasbynens/CSS.escape">use the polyfill</a> to maintain compatibility with browsers that don’t implement this yet.</p>

<h2 id="css-intrinsic-sizing">CSS intrinsic sizing</h2>

<p>The <a href="https://drafts.csswg.org/css-sizing-3/">CSS Intrinsic &amp; Extrinsic Sizing Module</a> extends the CSS sizing properties with the following keywords:</p>

<ul>
  <li><a href="https://drafts.csswg.org/css-sizing-3/#valdef-width-fill"><code>fill</code></a></li>
  <li><a href="https://drafts.csswg.org/css-sizing-3/#valdef-width-fit-content"><code>fit-content</code></a></li>
  <li><a href="https://drafts.csswg.org/css-sizing-3/#valdef-width-max-content"><code>max-content</code></a></li>
  <li><a href="https://drafts.csswg.org/css-sizing-3/#valdef-width-min-content"><code>min-content</code></a></li>
</ul>

<p>These keywords represent content-based “intrinsic” sizes and context-based “extrinsic” sizes, allowing CSS to more easily describe boxes that fit their content or fit into a particular layout context. <a href="https://googlechrome.github.io/samples/css-intrinsic-sizing/">A demo is available.</a></p>

<h2 id="cache-api-updates">Cache API updates</h2>

<p>The <a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-storage-match">Cache API</a> as available in <code>window</code> contexts, web worker contexts, and service workers contexts is now restricted to secure origins (such as HTTPS) only.</p>

<p><a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-addAll">The <code>addAll</code> method on <code>Cache</code> instances</a> takes an array of <code>RequestInfo</code> objects, fetches them, and adds the response objects into the <code>Cache</code> object.</p>

<h2 id="fetch-api-updates">Fetch API updates</h2>

<p><a href="https://dev.opera.com/blog/opera-31/#requestprototypecontext">Chromium 44 / Opera 31 added support for <code>Request.prototype.context</code></a> which has since been <a href="https://github.com/whatwg/fetch/issues/93">dropped</a> from the spec. To match the spec, support for this feature has been removed in Chromium 46 / Opera 33 after being deprecated in Chromium 45 / Opera 32.</p>

<p>The Fetch API also defines <a href="https://fetch.spec.whatwg.org/#concept-request-redirect-mode">a <code>redirect</code> setter on <code>Request</code> instances</a> that tells the browser how to treat redirect responses (i.e. HTTP status codes <code>301</code>, <code>302</code>, <code>303</code>, <code>307</code>, or <code>308</code>). This setter is now supported. It accepts the following values:</p>

<ul>
  <li><code>'follow'</code> — follow any redirect responses;</li>
  <li><code>'error'</code> — treat a redirect response as an error;</li>
  <li><code>'manual'</code> — don’t follow the redirect, and return an <a href="https://fetch.spec.whatwg.org/#concept-filtered-response-opaque-redirect">opaque-redirect filtered response</a> which wraps the redirect response.</li>
</ul>

<h2 id="http-client-hints">HTTP Client Hints</h2>

<p><code>DPR</code>, <code>Width</code>, and <code>Viewport-Width</code> hints enable proactive content negotiation between client and server, enabling automated delivery of optimized assets — e.g. auto-negotiating image DPR resolution, image size, and other optimized assets based on signals such as the client’s viewport width. For more details, see <a href="https://github.com/igrigorik/http-client-hints#use-cases">the list of use cases</a>.</p>

<p>Note that HTTP Client Hints can be used <a href="https://github.com/igrigorik/http-client-hints#picture-element">alongside</a> <a href="https://dev.opera.com/articles/responsive-images/">the <code>&lt;picture&gt;</code> element</a> to automate resolution switching, simplify art direction, and automate delivery of variable-sized images.</p>

<h2 id="http-public-key-pinning-reporting">HTTP Public Key Pinning reporting</h2>

<p>HTTP Public Key Pinning, or HPKP, is a standard that allows websites to send an HTTP header instructing the browser to remember (or “pin”) parts of its TLS certificate chain. The browser then refuses subsequent connections that don’t match the pins that it has previously received.</p>

<p>HPKP reporting can be used to detect misconfigurations as you’re rolling out HPKP. The Google Developers blog has <a href="https://developers.google.com/web/updates/2015/09/HPKP-reporting-with-chrome-46">a very good explanation</a> of how this works.</p>

<h2 id="performance-timeline-api-updates">Performance Timeline API updates</h2>

<p>The <a href="https://w3c.github.io/performance-timeline/">Performance Timeline APIs</a> (<code>performance.*</code>) were previously only available in <code>window</code> contexts. Now they are available in web worker contexts and service workers contexts as well.</p>

<p><a href="https://w3c.github.io/resource-timing/#extensions-performance-interface">Resource Timing-specific extensions</a> now work without the <code>webkit</code> prefix.</p>

<p>Additionally, <a href="https://w3c.github.io/resource-timing/#widl-PerformanceResourceTiming-workerStart">the <code>workerStart</code> property on <code>PerformanceResourceTiming</code> instances</a> is now supported.</p>

<h2 id="service-worker-updates">Service worker updates</h2>

<p><a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#clients-matchall-method">The <code>matchAll()</code> method on <code>Clients</code> instances</a> now returns the clients in most-recently-focused order, matching the spec.</p>

<p>The <code>update()</code> method on <code>ServiceWorkerRegistration</code> instances (which shipped in Chromium 45 / Opera 32) pings the server for an updated version of this service worker registration. In Chromium 46 / Opera 33, it now returns a promise that resolves with <code>undefined</code> if the operation completed successfully or if there was no update, and rejects if <code>update</code> failed. If the new worker ran but installation failed, the promise still resolves.</p>

<h2 id="proprietary-codecs-in-web-audio-api">Proprietary codecs in Web Audio API</h2>

<p>Opera now supports proprietary Web Audio API codecs. It is now possible to <a href="http://jxnblk.com/stepkit/">decode MP3s</a>, for example, if your system supports it.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/conferences/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/conferences/"/><title>The DevRel team is busy!</title><published>2015-09-28T00:00:00+00:00</published><updated>2015-09-28T00:00:00+00:00</updated><author><name>Bruce Lawson, Mathias Bynens, Shwetank Dixit, Vadim Makeev</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<figure block="figure">
	<img elem="media" src="/blog/conferences/devrel-team.jpg" alt="Opera DevRel team selfie" />
</figure>

<p>During the next few weeks, members of the Opera Developer Relations team are attending the following conferences:</p>

<ul>
  <li>September 25–27: <a href="http://2015.jsconf.eu/">JSConf EU</a>, Berlin</li>
  <li>September 26: <a href="http://2015.cssconf.eu/">CSSConf EU</a>, Berlin</li>
  <li>October 5–7: <a href="https://futureofwebapps.com/london-2015/">Future of Web Apps</a>, London</li>
  <li>October 8–9: <a href="https://fronteers.nl/">Fronteers</a>, Amsterdam</li>
</ul>

<p>If you’re there, come say hi!</p>

<p>As always, you can track our upcoming conference cameos <a href="http://lanyrd.com/opera/">on Lanyrd</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-32/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-32/"/><title>Opera 32 released</title><published>2015-09-15T00:00:00+00:00</published><updated>2015-09-15T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 32 (based on Chromium 45) for <a href="https://www.opera.com/computer">Mac, Windows, and Linux</a> and <a href="https://www.opera.com/mobile/operabrowser/android">Android</a> is out! To find out what’s new for users, see our <a href="https://www.opera.com/blogs/desktop/2015/09/opera-32-privacy-is-a-universal-right-2/">Desktop</a> and <a href="https://www.opera.com/blogs/mobile/2015/09/opera-32-add-to-home-screen/">Mobile</a> blogs. Here’s what it means for web developers.</p>

<h2 id="es6-arrow-functions">ES6 arrow functions</h2>

<p>Arrow functions enable a more succinct way of defining functions.</p>

<pre><code>const numbers = [1, 2, 3];
// Let’s use the so-called fat arrow syntax:
const squares = numbers.map(x =&gt; x * x);
// This is equivalent to:
const squares = numbers.map(function(x) {
	return x * x;
});
</code></pre>

<p>They differ from regular function definitions in that their <code>this</code> and <code>arguments</code> objects, as well as the new <code>super</code> and <code>new.target</code> variables, are lexically bound.</p>

<p>Check out <a href="http://www.2ality.com/2012/04/arrow-functions.html">Axel Rauschmayer’s post on arrow functions</a> for more information.</p>

<h2 id="es6-array-and-typedarray-additions">ES6 array and <code>TypedArray</code> additions</h2>

<p>The following ES6 array features are now available:</p>

<ul>
  <li><a href="http://ecma-international.org/ecma-262/6.0/#sec-array.from"><code>Array.from</code></a></li>
  <li><a href="http://ecma-international.org/ecma-262/6.0/#sec-array.of"><code>Array.of</code></a></li>
  <li><a href="http://ecma-international.org/ecma-262/6.0/#sec-array.prototype.copyWithin"><code>Array.prototype.copyWithin</code></a></li>
  <li><a href="http://ecma-international.org/ecma-262/6.0/#sec-array.prototype.fill"><code>Array.prototype.fill</code></a></li>
  <li><a href="http://ecma-international.org/ecma-262/6.0/#sec-array.prototype.find"><code>Array.prototype.find</code></a></li>
  <li><a href="http://ecma-international.org/ecma-262/6.0/#sec-array.prototype.findIndex"><code>Array.prototype.findIndex</code></a></li>
</ul>

<p>Furthermore, <code>TypedArray</code> subclasses such as <code>Int8Array</code> and <code>Float32Array</code> now support existing array methods such as <code>forEach</code> and <code>map</code>, as well as the abovementioned new methods.</p>

<h2 id="objectassign"><code>Object.assign()</code></h2>

<p>The <a href="http://ecma-international.org/ecma-262/6.0/#sec-object.assign"><code>Object.assign()</code></a> function copies the values of all enumerable own properties from one or more source objects to a target object. It returns the modified target object. This enables easily merging objects or cloning them shallowly.</p>

<pre><code>const first = { 'name': 'Tony' };
const last = { 'lastName': 'Stark' };
const person = Object.assign(first, last);

console.log(person);
// → { 'name': 'Tony', 'lastName': 'Stark' };
// Note: `first` was modified too!
console.log(first);
// → { 'name': 'Tony', 'lastName': 'Stark' };

// To avoid mutating `first`, use this instead:
const person = Object.assign({}, first, last);
</code></pre>

<h2 id="touchrotationangle"><code>Touch.rotationAngle</code></h2>

<p><a href="https://w3c.github.io/touch-events/#touch-interface">The Touch Events specification</a> defines a <code>rotationAngle</code> property for <code>Touch</code> instances. This value represents the rotation angle, in degrees, of the contact area ellipse defined by <code>radiusX</code> and <code>radiusY</code>.</p>

<h2 id="reduced-mouse-position-updates">Reduced mouse position updates</h2>

<p>While scrolling via trackpad or mousewheel, we previously sent mouse position updates every 100 milliseconds. Each mouse position update includes updating <code>:hover</code> styles, and dispatching <code>mousemove</code>, <code>mouseover</code>, <code>mouseenter</code>, <code>mouseleave</code>, and <code>mouseout</code> events. On pages with heavy mouse handlers or <code>:hover</code> styles, this could cause significant amounts of scroll jank.</p>

<p>To counter this, we no longer send mouse position updates while scrolling. Instead, we trigger this behavior 100 milliseconds after scrolling ends.</p>

<h2 id="deprecated-features">Deprecated features</h2>

<h3 id="mediastream-api">MediaStream API</h3>

<p>The following <a href="https://w3c.github.io/mediacapture-main/">MediaStream API</a> features have been removed from the spec, and are now deprecated in Opera and Chrome:</p>

<ul>
  <li><code>MediaStream.prototype.label</code></li>
  <li><code>MediaStream.prototype.ended</code></li>
  <li><code>MediaStream.prototype.stop()</code> (deprecated in favor of <code>MediaStreamTracks.prototype.stop</code>)</li>
</ul>

<h3 id="css--cssom">CSS / CSSOM</h3>

<p>The <code>CSSUnknownRule</code> interface, which used to represent an unsupported at-rule, has been removed.</p>

<p><code>CSSKeyframesRule.insertRule()</code> is deprecated in favor of <code>CSSKeyframesRule.appendRule()</code>.</p>

<p><a href="http://www.w3.org/TR/smil-animation/">SMIL</a> is now deprecated in favor of <a href="https://drafts.csswg.org/css-animations-1/">CSS Animations</a> and <a href="https://w3c.github.io/web-animations/">Web Animations</a>.</p>

<p>The <code>motion-offset</code>, <code>motion-path</code>, and <code>motion-rotation</code> CSS properties as defined in <a href="https://drafts.fxtf.org/motion-1/">the CSS Motion Paths specification</a> allow web pages to animate graphical objects along paths. <a href="https://googlechrome.github.io/samples/css-motion-path/">Check out the demo.</a></p>

<h3 id="dom">DOM</h3>

<p><a href="https://dom.spec.whatwg.org/#interface-attr">DOM <code>Attr</code> instances</a> (which represent attributes) now no longer have child nodes, matching the DOM spec.</p>

<p>The non-standard <code>compareNode()</code> and <code>expand()</code> methods on <a href="https://dom.spec.whatwg.org/#interface-range">the <code>Range</code> interface</a> have been removed.</p>

<p><code>document.charset</code> is a non-standard IDL attribute supported by all engines except Gecko. <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27436">There is a proposal to standardize it.</a> In order to simplify standardization, <code>document.charset</code> has been made readonly, as a simple alias of <code>document.characterSet</code>.</p>

<p>Support for the <code>filterRes</code> attribute for <code>&lt;filter&gt;</code> elements has been removed in order to align with <a href="https://drafts.fxtf.org/filters/#element-attrdef-filter-filterres">the spec</a>.</p>

<p>Finally, at <a href="https://www.w3.org/wiki/Webapps/WebComponentsApril2015Meeting">the Web Components F2F meeting in April 2015</a>, it was decided that support for multiple shadow roots should be dropped from the spec. Chromium now logs a deprecation warning whenever an element hosts multiple shadow trees:</p>

<pre><code>const div = document.createElement('div');
const shadowRoot1 = div.createShadowRoot();
const shadowRoot2 = div.createShadowRoot();
// Logs a deprecation warning.
</code></pre>

<p>Another result of that meeting is the deprecation of <code>&gt;&gt;&gt;</code> / <code>/deep/</code> and <code>::shadow</code> pseudo-elements in <a href="https://drafts.csswg.org/selectors/#dynamic-profile">dynamic profile</a>. When a <code>&gt;&gt;&gt;</code> combinator (the shadow-piercing descendant combinator formerly known as <code>/deep/</code>) is encountered in a selector, Chromium now replaces every element in the selector match list with every element reachable from the original element by traversing any number of child lists or shadow trees.</p>

<h2 id="csp2-self">CSP2 <code>self</code></h2>

<p>In <a href="https://w3c.github.io/webappsec/specs/content-security-policy/#source-list-guid-matching">Content Security Policy Level 2</a>, the <code>'self'</code> source expression explicitly excludes the <code>blob:</code> and <code>filesystem:</code> schemes. If you wish to include content at those URLs in your pages, update your CSP directives to explicitly include those schemes.</p>

<h2 id="cssgroupingrule"><code>CSSGroupingRule</code></h2>

<p><a href="https://drafts.csswg.org/cssom/#the-cssgroupingrule-interface">The CSSOM <code>CSSGroupingRule</code> interface</a> represents an at-rule that contains other rules nested inside itself. Per spec, <code>CSSMediaRule</code> and <code>CSSPageRule</code> inherit from <code>CSSGroupingRule</code>.</p>

<h2 id="service-worker-updates">Service worker updates</h2>

<h3 id="clientid"><code>Client.id</code></h3>

<p>We now support <a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#client-id">the <code>id</code> property of a <code>Client</code> instance</a>. Its value is a GUID allowing service workers to track client objects between termination and restart.</p>

<h3 id="clientpostmessage-and-serviceworkermessageevent"><code>Client.postMessage</code> and <code>ServiceWorkerMessageEvent</code></h3>

<p>Before Chromium 45, a Service Worker sending a message via <code>Client.postMessage()</code> resulted in a <code>MessageEvent</code> fired on the <code>Client</code>’s global scope (e.g. <code>window</code>). Since Chromium 45, the event is a <code>ServiceWorkerMessageEvent</code> fired on <code>navigator.serviceWorker</code> rather than <code>window</code>. <code>Client.postMessage</code> is now no longer considered to be an experimental feature.</p>

<h3 id="serviceworkercontainergetregistrations"><code>ServiceWorkerContainer.getRegistrations()</code></h3>

<p><a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#navigator-service-worker-getRegistrations">The <code>getRegistrations</code> method on <code>ServiceWorkerContainer</code> instances</a> returns all service worker registrations for the current origin.</p>

<h3 id="serviceworkerregistrationupdate"><code>ServiceWorkerRegistration.update()</code></h3>

<p><a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#service-worker-registration-update-method">The <code>update()</code> method on <code>ServiceWorkerRegistration</code> instances</a> pings the server for an updated version of this service worker registration without consulting caches.</p>

<h2 id="notificationoptionsvibrate"><code>NotificationOptions.vibrate</code></h2>

<p><a href="https://notifications.spec.whatwg.org/#dom-notificationoptions-vibrate">The Notifications API spec</a> defines a <code>vibrate</code> property on the <code>NotificationOptions</code> dictionary, which allows web developers to specify a vibration pattern for a notification.</p>

<h2 id="subresource-integrity">Subresource Integrity</h2>

<p><a href="https://w3c.github.io/webappsec/specs/subresourceintegrity/">Subresource Integrity</a> defines a mechanism by which user agents may verify that a fetched resource has been delivered without unexpected manipulation. In a nutshell, metadata inlined as HTML attributes allows the browser to determine whether the resource that was downloaded matches the resource the page’s author expected to download. Chromium now supports SI for <code>&lt;script&gt;</code> and <code>&lt;link rel="stylesheet"&gt;</code> elements.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-mini-11-modes/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-mini-11-modes/"/><title>Opera Mini 11 for Android’s new compression mode</title><published>2015-09-08T00:00:00+00:00</published><updated>2015-09-08T00:00:00+00:00</updated><author><name>Bruce Lawson</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Today, we released <a href="https://www.opera.com/blogs/mobile/2015/09/choose-high-or-extreme-savings-new-opera-mini-android/">Opera Mini 11 for Android</a>. It has two modes. By default, it starts in Extreme-compression mode. This is the traditional Opera Mini compression that can reduce a site down to 10% of its original size, using the Opera Presto rendering engine on a proxy server.</p>

<p>As always, this means a trade-off between experience and speed. Some sites may render differently, and some JavaScript won’t function as you expect. (Read more about <a href="https://dev.opera.com/articles/opera-mini-and-javascript/">Opera Mini and JavaScript</a> and <a href="https://dev.opera.com/articles/making-sites-work-opera-mini/">Making websites that work well on Opera Mini</a>.)</p>

<h2 id="high-compression-mode">High-compression mode</h2>

<p>This release adds a new compression mode we’re calling “High-compression” that is fully web-compatible. (You can turn this on by tapping the red “O” and choosing “Savings mode” next to the Savingsometer.)</p>

<figure block="figure">
	<iframe elem="media" width="560" height="315" src="https://www.youtube.com/embed/NHVz5KLqEnI" allowfullscreen=""></iframe>
</figure>

<p>This new mode preserves layout and JavaScript. In High mode, you can expect about 30% to 50% compression (it can be a lot more than 50% depending on your browsing habits). This is accomplished by the power of Snowdoo, a Scandinavian form of voodoo. All page assets are proxied through our servers and “squished” before they’re sent to the device, resulting in a smaller — and therefore faster — download. HTTPS pages are not proxied in this way.</p>

<p>The actual rendering depends on the <a href="https://developer.chrome.com/multidevice/webview/overview">WebView component</a> on the Android device. Older devices will have a WebView based on WebKit; more recent devices are Chromium-based, and from Android L, the WebView component is auto-updated.</p>

<h2 id="modes-in-other-opera-products">Modes in other Opera products</h2>

<p>Other Opera products have user-selectable rendering modes. See <a href="https://dev.opera.com/articles/browsers-modes-engines/">Opera Browsers, Modes &amp; Engines</a> for more information.</p>

<h2 id="fun-fact">Fun fact</h2>

<p>In beta versions of Opera Mini 11 for Android, High mode was on by default. We changed it after feedback that sites appeared “broken” because they didn’t render as people had come to expect from Opera Mini. It’s a good reminder that regardless of how you think your sites should look, your users know best; it’s their browser, and their choice.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/opera-31/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/opera-31/"/><title>Opera 31 released</title><published>2015-08-04T00:00:00+00:00</published><updated>2015-08-04T00:00:00+00:00</updated><author><name>Mathias Bynens</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Opera 31 (based on Chromium 44) for <a href="https://www.opera.com/computer">Mac, Windows, Linux</a> is out! To find out what’s new for users, see <a href="https://www.opera.com/blogs/desktop/2015/08/opera-31-speeds-up/">our Desktop blog</a>. Here’s what it means for web developers.</p>

<h2 id="css-multi-column-layout">CSS multi-column layout</h2>

<p>Chromium now includes a brand new implementation of <a href="http://www.w3.org/TR/css3-multicol/">multi-column layout</a> by Opera engineer Morten Stenshorne, solving historic issues with incorrect column balancing and interaction with compositing (hardware-accelerated layers). While it might have been possible to solve that in the old implementation, there was another big problem with the old implementation, code-wise: it needed a lot of hooks and special code in central layout code. The new implementation gives better support, and cleaner code that’s easier to maintain.</p>

<p>Note that for now, the <code>-webkit-</code> prefix is still required when using column layout-related styles.</p>

<p>A <a href="https://googlechrome.github.io/samples/multi-column-css/">multi-column demo</a> is available.</p>

<h2 id="documentscrollingelement"><code>document.scrollingElement</code></h2>

<p>Browsers disagree on whether <code>html</code> or <code>body</code> reflects the viewport for <code>scrollTop</code> et al. Some sites are using UA sniffing to decide which to use. Browsers want to align and use <code>html</code> (in standards mode), so sites that UA sniff need to be changed. To assist with this transition, Chromium now implements <a href="https://drafts.csswg.org/cssom-view/#dom-document-scrollingelement">the <code>document.scrollingElement</code> API</a>. Developers can now use that, falling back to <a href="https://github.com/mathiasbynens/document.scrollingElement">a polyfill</a> or whatever solution they were using previously.</p>

<p>See <a href="https://dev.opera.com/articles/fixing-the-scrolltop-bug/">Simon’s write-up on fixing the <code>scrollTop</code> bug</a> for more background.</p>

<h2 id="es6-computed-property-names">ES6 computed property names</h2>

<p>ES6 computed property names enable specifying properties in object literals whose names are the result of expressions rather than just hardcoded identifiers or strings.</p>

<pre><code>const prefix = 'foo';

const object = {
	[prefix + 'bar']: 'Hello',
	[`${prefix}baz`]: 'world'
};

`${object.foobar} ${object.foobaz}!`;
// → 'Hello world!'
</code></pre>

<h2 id="es6-unicode-code-point-escapes">ES6 Unicode code point escapes</h2>

<p><a href="https://mathiasbynens.be/notes/javascript-escapes#unicode-code-point">Unicode code point escapes</a> such as <code>\u{1F389}</code> are now supported in string and template literals. This way, any symbol can be escaped using its Unicode code point.</p>

<p>Before ES6, JavaScript supported the so-called “Unicode escape sequences” of the form <code>\uXXXX</code> which only allowed up to 4 hexadecimal digits. Code points requiring more than four hexadecimal digits, (such as the immensely important <a href="https://codepoints.net/U+1F389" title="U+1F389 PARTY POPPER">party popper emoji</a>), had to be represented using UCS-2/UTF-16 surrogate pairs.</p>

<pre><code>// Let’s represent the U+1F389 PARTY POPPER Unicode symbol
// in a JavaScript string using escape sequences.

// In ES5, we’d have to calculate the surrogates manually,
// and use two separate escape sequences:
console.log('\uD83C\uDF89');
// '🎉'

// In ES6, we don’t have to calculate anything — we can
// simply use Unicode code point escapes:
console.log('\u{1F389}');
// '🎉'
</code></pre>

<h2 id="cacheprototypeaddrequest"><code>Cache.prototype.add(request)</code></h2>

<p><a href="https://slightlyoff.github.io/ServiceWorker/spec/service_worker/#cache-add">The <code>add</code> method on <code>Cache</code> instances</a> is now supported. <code>add</code> takes <a href="https://fetch.spec.whatwg.org/#requestinfo">a <code>RequestInfo</code> object</a>, fetches it, and then adds the resulting response object to the cache.</p>

<h2 id="requestprototypecontext"><code>Request.prototype.context</code></h2>

<p>The read-only <a href="https://fetch.spec.whatwg.org/#requestcontext"><code>context</code> property of the <code>Request</code> interface</a> contains the context of the request (e.g. <code>'audio'</code>, <code>'image'</code>, <code>'iframe'</code>). This indicates what sort of resource is being fetched.</p>

<p>The <code>context</code> of a request is only relevant in the ServiceWorker API. A service worker can make decisions based on whether the URL is for an image, or an embeddable object such as a <code>&lt;video&gt;</code>, <code>&lt;iframe&gt;</code>, etc.</p>

<h2 id="web-audio-api-updates">Web Audio API updates</h2>

<p>Matching a change in <a href="https://webaudio.github.io/web-audio-api/">the Web Audio API specification</a>, the <code>buffer</code> property of an <code>AudioBufferSourceNode</code> can no longer be set more than once. This protects developers from the lack of control over when the new source starts. Previously (<a href="https://dev.opera.com/blog/opera-29/#web-audio-api-updates">as of Chromium 42 and Opera 29</a>), if the <code>buffer</code> property is assigned to more than once, a deprecation message was logged to the DevTools console. Now, doing so throws an error.</p>

<p>The channel order of <a href="https://webaudio.github.io/web-audio-api/#idl-def-ChannelMergerNode"><code>ChannelMergerNode</code></a> is now static after instantiation, matching the latest spec. This change addresses <a href="https://github.com/WebAudio/web-audio-api/issues/304">various</a> <a href="https://github.com/WebAudio/web-audio-api/issues/459">issues</a> with the previous implementation.</p>

<h2 id="whats-next">What’s next?</h2>

<p>If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following <a href="https://www.opera.com/developer">our Opera Developer stream</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/js-open-day-edge-conf/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/js-open-day-edge-conf/"/><title>JavaScript Open Day and Edge Conf</title><published>2015-07-01T00:00:00+00:00</published><updated>2015-07-01T00:00:00+00:00</updated><author><name>Andreas Bovens, Bruce Lawson</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p>Last week, Bruce and I were in London for two high-profile web standards events.</p>

<p>On Friday, Microsoft invited me to speak about installable web apps at their first <a href="http://jsopenday.azurewebsites.net/">JavaScript Open Day</a>: I talked about various exciting recent additions to the web stack, such as Service Workers and device APIs, and of course also “add to Home screen”, which we’ve <a href="https://dev.opera.com/blog/installable-web-apps/">previewed in a labs build</a> last week. You can find a video of my talk below.</p>

<figure block="figure">
	<iframe elem="media" width="560" height="315" src="https://www.youtube.com/embed/uDn-C6IGdVE" allowfullscreen=""></iframe>
</figure>

<p>On Saturday, it was time for <a href="https://edgeconf.com/2015-london">Edge Conference</a>, which is a “day of group discussion and debate on advanced web technologies for developers and browser vendors.” I moderated the “installing web apps” breakout session, which turned out to be an excellent one hour discussion with various browser representatives and mobile web developers, covering “add to Home screen” functionality, its UX, permissions, OS integration, and much more. It got the <a href="http://labs.ft.com/2015/07/edge-5-here-we-go-again/">best rating</a> of all Edge sessions, so you can tell we had a blast :)</p>

<p>For those interested, Bruce’s raw notes of the breakout are available on <a href="https://docs.google.com/document/d/1i0E5FYU8jjme-vDb7jCgtDA4XmyCRK-0yszvFff8dOQ/edit#">Google Drive</a> and here’s an image of the session as well.</p>

<figure block="figure">
	<img elem="media" src="/blog/js-open-day-edge-conf/breakout.jpg" alt="" />
</figure>

<p>As a final note, we’d be very interested in talking to any developers who are implementing add to Home screen, Service Workers or Push Notifications on real, commercial websites, with a view to publishing an article on Dev.Opera (we even pay!). Tweet us at <a href="http://twitter.com/odevrel">@ODevRel</a>.</p>
]]></content></entry><entry><id>https://dev.opera.com/blog/installable-web-apps/</id><link type="text/html" rel="alternate" href="https://dev.opera.com/blog/installable-web-apps/"/><title>Installable Web Apps and Add to Home screen</title><published>2015-06-24T00:00:00+00:00</published><updated>2015-06-24T00:00:00+00:00</updated><author><name>Andreas Bovens, Bruce Lawson</name></author><content type="html" xml:base="https://dev.opera.com/"><![CDATA[<p><em>Please note: this article is superseded by <a href="/articles/installable-web-apps/">Installable Web Apps and Add to Home screen</a> because the functionality described was released in Opera 32 for Android.</em></p>

<p>Today, we’re excited to release a <a href="https://www.opera.com/download/get/?partner=www&amp;product=android&amp;level=Developer">special labs build of Opera for Android</a> with an experimental new feature, called “Add to Home screen”, which you can find when clicking the small plus button on the left of the address bar.</p>

<p>When a user clicks “Add to Home screen” after loading your site in Opera, a shortcut to your site is placed on the Home screen of their device, allowing for direct access and increased visibility.</p>

<p>There is more though: “Add to Home screen” also supports the new <a href="https://w3c.github.io/manifest/">Web Manifest</a> spec, which means that a website added to the Home screen can be configured to open with a particular UI mode, orientation and more. It’s even run as a separate process, just like a native app. We call this “Installable Web Apps”.</p>

<h2 id="why">Why?</h2>

<p>We’re very excited about Installable Web Apps, as it bridges the gap between native and web apps in a most elegant way: it allows you to build applications using the full web stack that run in the browser as well as outside of it, without sacrificing crucial functionality like hyperlinking, and without the need for app stores or gatekeepers.</p>

<p>If you want to read more about why this is an exciting evolution, Alex Russell of the Google Chrome team has an excellent write-up called <a href="https://infrequently.org/2015/06/progressive-apps-escaping-tabs-without-losing-our-soul/">Progressive Apps: Escaping Tabs Without Losing Our Soul</a> that explains many of the advantages from both a developer and a consumer perspective.</p>

<p>Here are two more that appeal to us:</p>

<h3 id="no-update-distribution-lag">No update distribution lag</h3>

<p>With a centralised app store distribution model, the user receives a notification that a new version of your app is available; they download it and install it. However, in many parts of the world, data is expensive or WiFi is a luxury, so people don’t update over their mobile connections. This means that outdated versions of your app continue to be used long after you’ve released an update. If the outdated version has a security flaw, this is a problem.</p>

<p>With Installable Web Apps, the app is actually on your web server, so the instant you update it, everybody gets it, at the time they need it — there’s no update distribution lag, and the user isn’t wasting their precious data to download a complete new version of your app.</p>

<h3 id="less-storage-space-required">Less storage space required</h3>

<p>The <a href="https://think.storage.googleapis.com/docs/mobile-app-marketing-insights.pdf">average app user has 36 apps on their smartphone (PDF)</a>. 25% are used daily (social/comms/gaming); 25% are never used.</p>

<p>Those occasionally used apps are taking up a lot of storage on a device that may be inexpensive and therefore have little space. We know from the <a href="https://www.youtube.com/watch?v=7V-fIGMDsmE&amp;feature=youtu.be&amp;t=1h21m30s">2015 Google I/O keynote</a> that</p>

<blockquote>
  <p>Over a quarter of new Android devices have only 512 MB of RAM</p>
</blockquote>

<p>and, according to <a href="http://www.techrepublic.com/article/ram-a-lama-dont-be-a-ding-ding-about-android-storage/">Techrepublic</a>,</p>

<blockquote>
  <p>Internal storage is particularly important, because this is where your apps are stored. If you buy a budget or entry-level phone, you’ll probably find around 512 MB of internal storage. With this low amount of storage, you’ll only be able to install a few apps.</p>
</blockquote>

<p>Installable Web Apps only store an icon, a text-based JSON manifest and some cached data on the device, which is likely to use less storage.</p>

<h2 id="installation-mechanisms">Installation mechanisms</h2>

<p>In this labs build, site visitors can add a website to their Home screen by tapping the <strong>+</strong> icon on the left of the address bar.</p>

<figure block="figure">
	<video elem="media" mod="center" width="360" height="640" controls="">
		<source src="/blog/installable-web-apps/screen.mp4" type="video/mp4" />
		<source src="/blog/installable-web-apps/screen.webm" type="video/webm" />
	</video>
</figure>

<p>In a future release, we’ll make it more discoverable: under certain circumstances Opera will prompt the user to add the site they’re visiting to the Home screen.</p>

<h2 id="defining-icon-and-start-up-characteristics">Defining icon and start-up characteristics</h2>

<p>To make your site “installable”, you need to declare some characteristics in a special manifest file, and make sure it’s served over HTTPS. If it’s served over HTTP or the manifest is missing, a shortcut is placed on the Home screen, but you don’t get a real installable app, display modes and orientation settings don’t take effect, etc.</p>

<p>Spec author Marcos Cáceres and Bruce documented what goes in the manifest in an HTML5 Doctor article called <a href="http://html5doctor.com/web-manifest-specification/#appname">HTML App Manifest</a>.</p>

<p>You can check out the one we made for Dev.Opera on <a href="https://github.com/operasoftware/devopera/blob/master/src/.webmanifest">GitHub</a>.</p>

<h2 id="display-modes">Display modes</h2>

<p>The specification defines <a href="https://w3c.github.io/manifest/#display-modes">display modes</a>: in essence, these are different ways to show your web app.</p>

<p>Opera for Android supports</p>

<ul>
  <li><code>fullscreen</code> — the app will take all the screen; hardware keys and the status bar will not be shown. Note, this is not the same as HTML5 <code>fullscreen</code> mode.</li>
  <li><code>standalone</code> — no browser UI is shown, but the hardware keys and status bar will be displayed.</li>
  <li><code>browser</code> — the app will be shown with normal browser UI, ie. as a normal website. Note that custom orientations are not yet supported in this mode.</li>
</ul>

<p>The <code>minimal-ui</code> mode is not supported; it falls back to <code>browser</code> as the spec requires.</p>

<h2 id="navigating-outside-the-apps-scope">Navigating outside the app’s scope</h2>

<p>If the user follows a link that takes them outside the domain of an installed web app, the browser will flash 68 times, the device will vibrate like a walrus possessed by Satan and a klaxon will sound. Just kidding! In that case, the externally linked site will open in a new tab in Opera, showing the address bar, so you know where you are.</p>

<h2 id="conclusion">Conclusion</h2>

<p>At Opera, we’re excited to promote Web Apps to be “first-class citizens” on Android devices and beyond, with visibility alongside native apps; we love the Web and we want to see it thrive.</p>
]]></content></entry></feed>