The Most Secure Cross Browser Testing Platform since 2012

Blog

Chrome 40: All New Features Explained

chromelogo
Browsers

Chrome 40: All New Features Explained

On January 21 Google released the latest version of the browser Chrome: Version 40. Alongside many security fixes the update includes the minlength attribute, reportValidity function, JavaScript Service Workers and numeric literals inside JavaScript. Learn all about the relevant new features here.

Form Validation: minlength Attribute

In Chrome 40 the new minlength attribute is activated by default. This attribute can be used on different form fields to specify the minimum length the user must enter. A quick example:

<minlength="5" maxlength="50"/>

This feature is already available in Opera 27 and is currently in development in Firefox.

Further reading:

Form Validation: reportValidity() Function

Now you can invoke the browser form validation in Chrome without submitting the form. To do this simply call the JavaScript function

reportValidity();

This feature is also available in Opera 27.

Further reading:

JavaScript Service Workers

Like Opera 27, Chrome now supports so called JavaScript Service Worker (also known as Navigation Controllers). These Service Workers can be used to intercept network events and therefor make your web application offline capable. Check out the demos below for better understanding.

Further reading:

JavaScript Numeric Literals

Like Firefox and Opera 27, Chrome now supports binary and octal numeric literals in JavaScript. This means you can now do things like this:

var FLT_SIGNBIT  = 0b10000000000000000000000000000000; // 2147483648
var n = 0O755; // 493

Further reading: