You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This proposal introduces four [Document Policy](https://github.com/WICG/document-policy/blob/main/document-policy-explainer.md) configuration points to constrain the performance impact of iframes in the embedding document. Each configuration point enables monitoring for performance-impacting behavior in the iframe, and reports occurrences of such behavior as policy violations through [Reporting API](https://wicg.github.io/document-policy/#reporting). Violations are reported to both the embedding and embedded document. Resources that incur policy violations are blocked from loading.
6
+
7
+
A working prototype for the first category `basic` is to be implemented in the following stages:
8
+
***Stage 1.** Configuration point and policy monitoring, reporting.
9
+
***Stage 2.** Resource blocking.
10
+
***Stage 3.** Cross-document reporting.
11
+
12
+
More details on the behavior for the `basic` category can be found in ["basic" category overview](https://docs.google.com/document/d/1RGxvtkoQbvApLVdipiASoUQjC0Jf-IKD9qV1EfUJHAQ).
-[Reporting 3rd party violations to embedder](#reporting-3rd-party-violations-to-embedder)
54
+
-[Interaction with Heavy Ad Interventions](#interaction-with-heavy-ad-interventions)
55
+
-[Open question: how can we ensure fair restrictions for various types of devices (e.g. low end vs. high end devices)?](#open-question-how-can-we-ensure-fair-restrictions-for-various-types-of-devices-eg-low-end-vs-high-end-devices)
56
+
-[Open question: how to determine categories/criteria/limits for desktop vs. mobile?](#open-question-how-to-determine-categoriescriterialimits-for-desktop-vs-mobile)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
8
60
9
61
## Introduction
10
62
@@ -141,6 +193,9 @@ There are various layers of configuration that can happen and we need to ensure
141
193
142
194
## Security and Privacy Considerations
143
195
196
+
### Potential privacy implications of blocking embedded content
197
+
We propose to [report violations across documents](#reporting-3rd-party-violations-to-embedder). These reports may expose information about the embedded document state to the embedder. We consider that because policies defined through Document Policy require opt-in, the embedded document accepts the risks by agreeing to the policy. See discussion in [#1077](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1077) (resource blocking) and [#1085](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1085) (reporting leaks).
198
+
144
199
### Global budgets and side-channel attacks
145
200
The proposed criteria include budgets which are shared globally across documents. This could allow for documents to learn things about cross-origin documents, as described in the [Never Slow Mode explainer](https://github.com/slightlyoff/never_slow_mode?tab=readme-ov-file#global-limits). We consider the same alternatives introduced for NSM as viable for this proposal:
146
201
* Require CORS
@@ -188,10 +243,19 @@ With this approach, adding a new group of constraints would only be possible by
188
243
189
244
## Open Issues
190
245
191
-
### Per-document constraints
192
-
Document Policy directives are effective on a per-document basis. This generally makes it harder for constraints to have the desired impact to improve performance, as the overall cap on resources increases with the complexity of the page. We propose capping the overall complexity and resources through frame depth and count restrictions to avoid an unbound upper limit to page resource consumption.
246
+
### Policy enforcement options
247
+
We aim to block loading for resources that violate the `basic` policy. Non-breaking enforcement might help with adoption. See discussion in [#1082](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1082)and [#1079](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1079).
193
248
194
-
What would be the appropriate frame count and depth limit? See related discussion in [Security and Privacy Considerations](#frame-depth).
249
+
### Limits need to be defined
250
+
We propose to have concrete limits managed by the platform, but defaults can't change without breakage. See discussion in [#1083](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1083) and [#1084](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1084).
251
+
252
+
**`basic` category limits**
253
+
* HTTP-based compression of text-based resources
254
+
* Opt for compressed formats when available (non text-based resources)
255
+
* Keep size of non-HTTP compressed resources low
256
+
* data: URLs: 100kB
257
+
* Images: 1MB
258
+
* Fonts: 96kB
195
259
196
260
### Criteria and category definition, evolution
197
261
This proposal provides an affordance for web developers to gain back control over the performance of their web property. A set of performance-impacting criteria was derived from [Never Slow Mode](https://github.com/slightlyoff/never_slow_mode?tab=readme-ov-file#global-limits) and experience in the field (see note in [Proposed Solution](#proposed-solution)). These criteria were then grouped into buckets, taking into account their overall impact, stage in the document lifetime and estimated effort from the developer to fix.
@@ -213,9 +277,19 @@ We expect these criteria and their specific limits to evolve with the web, which
213
277
3.**Updated criteria under new category tags**
214
278
|**Pros**|**Cons**|
215
279
|---|---|
216
-
|- Web developers can anticipate and address violations. | - Requires changes from sites each time there's a change in a category. |
280
+
|- Web developers can anticipate and address violations. | - Requires changes from sites each time there's a change in a category.<br>- New configuration point required for every policy change. |
281
+
282
+
4.**Use versioning**
283
+
Bundle criteria updates into versions of the policy and let the document specify which policy version is requested or opted-in to by using a parameterized configuration point instead. Sites need to actively adopt new versions of the policy.
284
+
| **Pros** | **Cons** |
285
+
|---|---|
286
+
|- Web developers can anticipate and address violations.<br>- Changes can happen within the same configuration point. | - Requires changes from sites each time there's a change in a category. |
287
+
Versioning is the preferred mechanim as it allows for policy evolution to happen in a controlled, predictable manner.
288
+
289
+
### Per-document constraints
290
+
Document Policy directives are effective on a per-document basis. This generally makes it harder for constraints to have the desired impact to improve performance, as the overall cap on resources increases with the complexity of the page. We propose capping the overall complexity and resources through frame depth and count restrictions to avoid an unbound upper limit to page resource consumption.
217
291
218
-
An ideal mechanism would allow for this evolution go happen in a controlled, predictable manner. An open point for discussion is whether it's a reasonable trade off for developers opting in to be expected to keep up with the platform as criteria evolves.
292
+
What would be the appropriate frame count and depth limit? See related discussion in [Security and Privacy Considerations](#frame-depth).
219
293
220
294
### Reporting 3rd party violations to embedder
221
295
Embedders are best equipped to influence change in the performance when they are aware of where the issues are. While Document Policy provides a Reporting API integration, this only reports violations to the endpoint of the document where the violation occurs. Embedders do not receive reports that the embedded content has incurred policy violations, which is a limitation. We are currently considering sending a minimal report to the embedder when a violation occurs in the embedded document.
0 commit comments