Opera 29 released
Opera 29 (based on Chromium 42) for Mac, Windows, Linux and Android is out! To find out what’s new for users, see our Desktop and Mobile blogs. Here’s what it means for web developers.
ES6 classes
ES6 classes are syntactical sugar over the classical prototype-based inheritance pattern in JavaScript using objects and prototypes. Classes offer a much cleaner and simpler syntax for creating these objects and dealing with inheritance. Having a single convenient declarative form makes class patterns easier to use, and encourages interoperability.
Opera now supports ES6 classes in strict mode, providing the following features: prototype-based inheritance, constructors, super
calls, instance methods, and static methods. A demo is available.
ES6 extended object literals
The object literal notation (or “object initializer” as the ECMAScript spec calls it) gets an upgrade in ES6. It is now possible to use shorthand property names, where the property name is automatically inferred from the variable name:
const a = 'foo';
const b = 42;
const c = {};
const object = { a, b, c };
// → { a: 'foo', b: 42, c: {} }
Also supported are shorthand method names:
const object = {
property([parameters]) {},
get property() {},
set property(value) {},
* generator() {}
};
…and computed property names:
const property = 'foo';
const object = {
[property]: 'Hello',
['b' + 'ar']: 'world',
};
// → { foo: 'Hello', bar: 'world' }
Fetch API
The Fetch API is a low-level promise-based standard for Ajax requests. Opera already supported this API in service workers, but as of this release it is now also available in the window
context, in shared workers, and in dedicated workers.
Until fetch
browser support becomes more widespread, we recommend using a polyfill.
For more information about this new API, see Introduction to fetch()
.
Web Audio API updates
Matching a change in the Web Audio API specification, the buffer
property of an AudioBufferSourceNode
should no longer be set more than once. This protects developers from the lack of control over when the new source starts. From now on, if the buffer
property is assigned to more than once, a deprecation message is logged to the DevTools console.
The startRendering
method of an OfflineAudioContext
now returns a promise that resolve
s with the rendered audio when rendering has finished. A demo is available.
Note: The Web Audio API implementation in Opera doesn’t yet support proprietary codecs such as MP3. (This is in contrast to <video>
and <audio>
, which already hook into the codecs made available by the operating system.) We’re working to fix this as soon as possible.
cut
and copy
commands
Opera now supports the cut
and copy
commands through the document.execCommand()
method. This enables programmatically cutting or copying text to the operating system’s clipboard.
This already works in Internet Explorer 10+, and Chrome 43 and Firefox 40 will support this too.
See the HTML5 Rocks tutorial on the cut
and copy
commands for more information.
JavaScript performance improvements
Chromium 42 implements code caching, which avoids recompiling cached JavaScript code on every visit. See “New JavaScript techniques for rapid page loads” for more information.
Text wrap enabled on Opera for Android
To aid with your responsive designs, Opera for Android now wraps text by default so that your readers never need to scroll horizontally, no matter how much they zoom in.
What’s next?
If you’re interested in experimenting with features that are in the pipeline for future versions of Opera, we recommend following our Opera Developer stream.