Facebook Targets Browser Queueing Delays With New isInputPending API in Chrome 74

Facebook has announced that a new isInputPending API it created is included in Chrome 74, the latest version of Google's popular Chrome browser, as an origin trial.

The social networking giant created the isInputPending API to address a problem it identified in measuring user interactions with its service: the fact that queueing time was consistently producing some of the biggest delays.

The isInputPending API introduces the concept of interrupts for user inputs. As Facebook's Nate Schloss and Andrew Comminos explained in a blog post, instead of making a choice between loading pages fast and responding to events fast, the new API "hooks into Chrome's compositor-side input queue to intercept events before they're posted to the main thread. As all processing of these input events is done off the main thread, calls to isInputPending do not use many computational resources and should be very quick. This allows developers to invoke the API frequently and maximize responsiveness."

In simple terms, the API, which is exposed through a JavaScript Function, navigator.scheduling.isInputPending(), gives developers the ability to determine whether user input is pending and then direct the browser to either continue doing its work or stop work so that the event can be handled. By default, the function looks for any kind of user input but developers can also direct it to look only for specific types of user input, including mouse, wheel, touch, and key DOM UI events.

As the isInputPending API is part of an origin trial, its future in Chrome is not guaranteed. If feedback is positive, it could become a permanent feature that ultimately helps developers "get rid of these noticeable queueing delays and make the web experience faster and more fluid" for users.

Facebook says it hopes to make further contributions to open-source browsers, and hinted that it could contribute additional APIs down the line in what represents a new approach for the company to influence web standards.

Be sure to read the next Browsers article: Google Proposes New Features for WebAssembly