Facebook announces first major browser API contribution for faster input events

Facebook announces first major browser API contribution for faster input events
Image Credit: Wikimedia

Facebook has announced its first major API contribution to Google's Chrome browser. The social networking giant's team proposed a new API and worked closely with its counterparts at Google Chrome to improve both overall JavaScript execution time and event response times (time between user input and browser response).

Facebook engineers wrote in a blog post on Monday, "We felt we could make a significant improvement, so we proposed a new API and worked closely with our counterparts at Google Chrome to contribute code for an origin trial. We are excited to share that the Chrome 74 release will include the origin trial for our isInputPending API. This origin trial is a first step to improve scheduling JavaScript on the web."

The team hopes to take developer feedback from this trial and use it to make the case for fully shipping the API.

The isInputPending API is the first to use the concept of interrupts for user inputs to the web. The 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, the post explained.

"If the trial is successful, isInputPending could become fully available in Chrome. We would then be able to fix these noticeable queueing delays and make the web experience faster and more fluid for the people on our sites," Facebook engineers said. Furthermore, the company hopes to continue driving new APIs and to ramp up its contributions to open source web browsers. Also, isInputPending is now part of a larger effort to build scheduling primitives into the web.

Give Feedback

Use this form for editorial or site feedback. We usually reply within 2 to 3 working days.

By submitting, you agree that we may use your email address to respond.