News

Chrome 71 Beta is here with a relative time format and more

2 min read

Chrome 71 beta was released yesterday with international relative time formats and other features.

A relative time format in Chrome 71 Beta

Phrases like ‘yesterday’ or ‘three months’ are common while writing or speaking. But such phrases are not a part of the built-in date and time APIs. So using them in code is not possible. To fulfil this need, libraries provide localized versions of such phrases. But using them required downloading customary phrases for each supported language thereby increasing the bundle size and download time.

Chrome 71 Beta has a new Intl.RelativeTimeFormat() function which shifts this job of phrases to the JavaScript engine. Examples to show how this works:

const rtf = new Intl.RelativeTimeFormat('en');

rtf.format(3.14, 'second');
// → 'in 3.14 seconds'


rtf.format(-15, 'minute');
// → '15 minutes ago'

This API can even do things like retrieving information for multiple languages, dealing with parts of a date or time individually etc. For more details on this, visit the Chrome post.

Some other features in Chrome Beta 71

Apart from the addition of a relative time format, other features have been added.

FullscreenOptions

The Element.requestFullscreen() method can now be customized on Android with the use of an optional options parameter. The navigationUI parameter allows choosing between making the navigation bar visible or a completely immersive mode where no controls are shown on the screen until a gesture is performed to bring out the navigation.

Support for new font types

Chrome Beta 71 brings support for COLR/CPAL fonts. These are a type of OpenType color font composed of layers. The layers are made of vector outline glyphs and color palette information. With this addition, Chrome now supports three color font formats which are cross-platform. The other two are CBDT/CBLC and SBIX.

MediaElement and MediaStream nodes defined only for AudioContext

Chrome Beta 71 allows creation of MediaElementAudioSourceNode, MediaStreamAudioSourceNode, and MediaStreamAudioDestinationNode elements exclusively by using an AudioContext. In older versions these could be created using an OfflineAudioContext, but that is not supported anymore due to spec compliance and real-time nature of the nodes not being met by OfflineAudioContext.

Some interoperability improvements

For interoperability with other browsers, Chrome now calls capture event listeners in the capturing phase. This is done at shadow hosts, while previously it was done in the bubbling phase.

Chrome now calculates the specificity for the :host() and :host-context() pseudo classes and also for the arguments of ::slotted(). This makes it compliant with the Shadow DOM v1 spec.

Items removed in Chrome Beta 71

The items removed in this version are:

  • SpeechSynthesis.speak without user activation
  • importScripts() of new scripts after service worker installation
  • prefixed versions of several APIs
  • URL.createObjectURL for MediaStream
  • document.origin

For a complete list of features and details, visit the Chromium Blog.

Read next

Chrome 70 releases with support for Desktop Progressive Web Apps on Windows and Linux

Chrome V8 7.0 is in beta, to release with Chrome 70

Chrome 69 privacy issues: automatic sign-ins and retained cookies; Chrome 70 to correct these

Prasad Ramesh

Data science enthusiast. Cycling, music, food, movies. Likes FPS and strategy games.

Share
Published by
Prasad Ramesh

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago