Skip to content

nyaxt/lazyembeds

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 

Repository files navigation

LazyEmbeds: Explainer

Authors

Participate

Introduction

Third-party embeds enable sites to integrate engaging web experiences hosted by third-party origins on a first-party site - this includes video players, social media content and widgets. While such embeds can supercharge a site's experience, they also come with a range of performance and privacy caveats.

For example, it’s not uncommon for an embed to request and execute large amounts of script, which can have a surprising impact on the performance of the parent page - from resource contention to delaying interaction readiness. Similarly, embeds can often include tracking capabilities that may not be obvious to embedders.

We (Google Chrome team) are currently exploring if perceived page load speed can be improved by introducing a different loading schedule to third-party embeds. Here, we draw attention to cross-origin <iframe>s, which is widely used to integrate a website with such 3rd party SaaS.

Goals

User agent explores different loading schedules for cross-origin <iframe>s. This is done by inserting arbitrary delays before cross-origin iframe to start.

We aim to selectively apply the delay using heuristics gathered from signals such as:

  • Whether <iframe> is in the viewport or not
  • Size of the iframe
  • The origin of the iframe
  • etc.

Non-goals

We currently do not plan to apply the delay to same-origin iframes.

The monkey patch to HTML spec

The will lazy load element steps is modified to take request as an additional parameter. Also, we insert the following steps before step 3:

  1. If element’s lazy loading attribute is set and is in the Eager state, then return false.

  2. If element’s document’s URL is not same origin with request’s URL’s origin, optionally, the user agent may choose to return true, if it believes doing so would improve the loading experience.

About

LazyEmbeds proposal - Explainer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published