Chrome 47 Beta: Idle time work, splash screens, and desktop notification management
Thursday, October 22, 2015
Splash screens on Android
Mobile devices are typically less powerful than desktops, meaning apps can take a few seconds to load. Splash screens allow apps to show something meaningful to users as the app loads, improving perceived performance. The new version of Chrome for Android brings splash screens to web apps when a site is launched from the Android home screen. The splash screen is shown immediately, even while Chrome itself is loading. Developers can customize the splash screen by setting a name, icon, background color, and notification bar color in the web app manifest. The splash screen disappears once the web app begins to draw to the screen, providing a more polished loading experience.
Cooperative multitasking with requestIdleCallback()
To achieve a screen refresh rate of 60 frames per second, developers must guess when performance-critical tasks like rendering will finish and use timers to schedule around them. Unfortunately, developers can’t guarantee that low priority work won’t hurt performance because events like scrolling cannot be predicted. Now developers can explicitly set work to run during idle time using requestIdleCallback(). Functions registered with requestIdleCallback() are given a deadline and can return before that limit is reached to avoid jank. The function can register for another requestIdleCallback() to continue work during the next idle period.
Auto dismissing notifications
Push notifications have been enabled by service workers since Chrome 42. Sites such as social media or email can generate a large number of push notifications that take up screen space and aren’t particularly relevant unless viewed soon after posting. The new version of Chrome now allows developers to configure automatic dismissal of desktop notifications, improving the experience for these kinds of notifications. Sites can set NotificationOptions.requireInteraction to indicate the notification should remain onscreen until the user dismisses it.
Other updates in this release
- The rest parameters syntax allows functions with an indefinite number of arguments to be called using arrays.
- RequestInit.referrer allows requests captured by service workers to match the original referrer.
- The new Navigator.MediaDevices interface allows developers to enumerate connected media devices such as audio output.
- MouseEvent.getModifierState() makes input processing more powerful and consistent across MouseEvent and KeyboardEvent.
- Developers can now more accurately detect input device capabilities using UIEvent.sourceCapabilities and InputDeviceCapabilities.firesTouchEvents.
- Several SVG methods have been removed, including pixel conversions and hasExtension() methods on several elements.
- Prefixed encrypted media extensions are now disabled in favor of unprefixed EMEs, which have more capabilities and conform to the spec.
Posted by Ross McIlroy, Scheduling Samurai