'Google Chrome 74' stable release, private field appeared in JavaScript class syntax



Version 74.0.3729.108, the latest stable version of the web browser Google Chrome, has been released. Google Chrome 74 implements a JavaScript private class field, as well as a CSS media query that allows you to determine what happens when the user is setting up an animation.

New in Chrome 74 | Web | Google Developers
https://developers.google.com/web/updates/2019/04/nic74

New in Chrome 74: Private Class Fields, Prefers Reduced Motion, CSS Transition Events, & more!-YouTube


Private class field
Since there was no class implementation in JavaScript in the past, it was treated like a class by devising a simple object. Class syntax appeared in the version of JavaScript defined in 2015, but at this time all member variables are public because of maintaining compatibility etc., and can be rewritten anytime and anywhere There was a risk of

In Chrome 74, you can make a private variable that can not be accessed from outside the class by putting '#' at the beginning of the member variable.



・ 'Does not show animation' media query is implemented
Some users have indicated that they do not want the animation to be displayed on the web page.



By specifying 'prefers-reduced-motion: reduce' in the media query of CSS in Chrome 74, you can set the style for people who have turned on the setting 'do not show animation'.



・ As CSS transition raises an event
By setting a transition in CSS, it is possible to make settings such as 'Change slowly over a few seconds' to change the color when moving the cursor over the button. Starting with Chrome 74, contextual events are triggered when these transition events occur.



If you want something to happen when an event occurs, configure an event listener.



・ API added to confirm access to camera and location information etc.
A mechanism called ' Feature Policy ', which is a system for transferring the authority for accessing information permitted within the iframe called by the site, when the browser gives access to location information etc. to any site. Exists.



Chrome 74 has implemented an API to check which privileges are granted under this Feature Policy.



Chrome 74 also includes 39 security bug fixes.

in Software, Posted by log1d_ts