Contact emails
{shivanisha, bmcquade, jkarlin, kenjibaheux}@chromium.org
Spec
The Spec change is being discussed in this issue.
Summary
This intervention blocks the load of cross-site, parser-blocking scripts inserted into the main document via document.write over 2G connections. To minimize breakage, the intervention issues async requests for blocked resources. The intervention does not trigger on page reload or when the resource is cached.
User benefits from the intervention are impressive: 25% more page loads that complete (i.e. fully parsed) and 38% faster mean time to page load completion - representing an improvement of nearly six seconds. Also, we saw 10% fewer reloads suggesting a decrease in user frustration and by consequence a very low rate of breakage.
Motivation
Historically, third party content such as ads and analytics used document.write to load script resources. Despite widespread support for asynchronous loading, roughly 13% of page loads continue to use document.write in a way that harms performance.
Based on instrumentation in Chrome, we've learned that pages featuring third-party scripts inserted via document.write() are typically twice as slow to load as other pages on 2G.
From a field trial with Chrome stable users, we learned that:
7.6% of all page loads on 2G were impacted by the intervention
10% more page loads reached first contentful paint (the visual confirmation for the user that the page is effectively loading)
25% more page loads reached the fully parsed state.
10% fewer reloads suggesting a decrease in user frustration.
21% decrease of the mean time for the first contentful paint (over one second faster)
38% decrease of the mean time it takes to parse a page (representing an improvement of nearly six seconds).
See this additional analysis for more details and additional insights.
The significant boost in terms of page views and user engagement clearly shows that speed matters. This also suggests that sites experiencing breakage may still benefit overall and would further improve their success metrics by adopting an asynchronous loading pattern.
Interoperability
We’ve discussed this intervention and shared our learnings with other browser vendors via an issue filed in the WICG Interventions github, as well as emails and face to face discussions. We also reached out to many third parties and industry bodies to discuss this intervention. In general, document.write has long been seen as a problematic API and there is a shared desire to find a way out.
Compatibility Risk
Most scripts inserted via document.write are for third party content such as ads and analytics, which lowers the likelihood of breaking the main content of the page as a result of this intervention. To further minimize the risk, the intervention only triggers under specific circumstances and features the following mitigations:
The intervention does not trigger for same-site scripts (i.e. hosts with matching eTLD+1).
Asynchronous requests are issued for the resources that were blocked and would then be loaded on subsequent navigations.
Reload gestures inhibit the intervention.
Debuggability
Beside the usual warning and error messages in DevTools, an Intervention HTTP header is sent to the URL of the relevant resources:
To warn of the possibility of an intervention (e.g. when the user was not on 2G):
Intervention: <https://www.chromestatus.com/feature/5718547946799104>; level="warning"
To report an actual intervention:
Intervention: <https://www.chromestatus.com/feature/5718547946799104>
Web authors can look for these headers, in combination with the Referer header, to understand which integration points are at risk or impacted by the intervention.
To simulate the effect of the intervention, we recommend using Chrome canary and enabling chrome://flags/#disallow-doc-written-script-loads which will force the intervention on all connections.
None.
Will this feature be supported on all six Blink platforms (Windows, Mac, Linux, Chrome OS, Android, and Android WebView)?
All platforms except WebView. However, the intervention will only trigger on Android and Chrome OS because other platforms do not support the detection of the connection type.
OWP launch tracking bug
Link to entry on the feature dashboard
https://www.chromestatus.com/features/5718547946799104LGTM2.
--
You received this message because you are subscribed to the Google Groups "blink-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+unsubscribe@chromium.org.
LGTM3
LGTM2.
To unsubscribe from this group and stop receiving emails from it, send an email to blink-dev+...@chromium.org.
55 is the version we've been aiming for.
--