Menu

What’s new in Chromium 55 and Opera 42

December 14th, 2016

Opera 42 (based on Chromium 55) for Mac, Windows, Linux is out! To find out what’s new for users, see our Desktop blog. Here’s what it means for web developers.

Built-in currency converter

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

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.

Currency symbols are supported, but for ambiguous symbols (e.g. “$”, “kr”) we recommend using the ISO 4217 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>USD 50</p>
<p>995 SEK</p>

Input handling improvements

The PointerEvent standard is now supported. It gives developers a unified API for handling “pointer” user input, whether that is mouse, touch, pen, etc. PointerEvent also does not block scrolling, which should reduce jank during scrolling. When using TouchEvent, the same performance benefit can be achieved using passive event listeners. The touch-action CSS property is now also supported, to allow reacting to gestures such as panning. For more information, see Pointing the Way Forward by Sérgio Gomes.

The auxclick event is now fired for non-primary mouse buttons, instead of click.

JavaScript async and await

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

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

For more information, see Async functions - making promises friendly by Jake Archibald.

CSS automatic hyphenation

The hyphens 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 none, manual (initial value) and auto.

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

html { hyphens: auto; }
code { hyphens: manual; }

See demo.

once event listener option

The once event listener option` is now supported, for a convenient way to only invoke an event listener once and then remove the listener.

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

For more information, see Once Upon an Event Listener by Jeff Posnick.

Persistent storage

Persistent storage is now on by default.

TLS

  • The TLS stack now implements GREASE, a mechanism to help prevent problems with buggy TLS servers.
  • RSA-PSS signature algorithms have been added to TLS to prepare for TLS 1.3.

New constructors

new MediaStreamTrackEvent(type, options) and new AudioNode(context, options) constructors are now available.

document.write() intervention

Cross-origin and parser-blocking scripts injected using document.write() will no longer load over 2G connections. See this article by Paul Kinlan for more information.

Deprecated and removed features

  • As mentioned above, the click event is no longer fired for non-primary mouse buttons. In most cases this is desirable; click 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 auxclick event can be used. The contextmenu event can also be used to handle clicks that would open a context menu (typically right-click).
  • BaseAudioContext will replace AudioContext in the Web Audio API.
  • CSS Clipping Path properties no longer require the webkit prefix.
  • The MediaStream constructor is now available without prefix alongside the existing webkitMediaStream.
  • Non-script MIME types for external scripts (e.g., <script src="foo" type="something/something">) is deprecated and will from M56 (Opera 43) no longer be pre-fetched. This typically results in less wasted fetches. <script data-src="foo" type="something/something"> is recommended instead.
  • <textarea maxlength=""> and <textarea minlength=""> have been updated to count each line break as one character, instead of two.
  • The webkit prefix has been removed from the imageSmoothingEnabled property of CanvasRenderingContext2D.

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.