Skip to content

Commit 3664ee0

Browse files
committed
add flags instructions
1 parent 94ead0c commit 3664ee0

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

explainers/permissions-policy-deprecate-unload.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,42 @@ The currernt proposal makes this a tempoarary state.
313313

314314
No other concerns are known.
315315

316+
# Testing with Chrome
317+
318+
## Controlling unload with Permissions Policy
319+
320+
As of [106.0.5229.0](https://chromiumdash.appspot.com/commit/5c436e20b6d923241eadd2afe8b846ed32d46eea),
321+
a flag is available to control whether Permissions-Policy controls unload.
322+
To enable this,
323+
you can start Chrome with
324+
325+
```
326+
--enable-features=PermissionsPolicyUnload
327+
```
328+
329+
## Disabling unload by default
330+
331+
As of [117.0.5924.2](https://chromiumdash.appspot.com/commit/2cf526285beacdfebe2251a20ad5550b3487a277),
332+
flags are available to control the deprecation.
333+
To force the deprecation,
334+
you can start Chrome with
335+
336+
```
337+
--enable-features=PermissionsPolicyUnload,DeprecateUnload --disable-features=DeprecateUnloadByUserAndOrigin
338+
```
339+
340+
After that you can open a devtools window and try
341+
342+
```
343+
addEventListener("unload", () => {})
344+
```
345+
346+
You should see
347+
348+
```
349+
[Violation] Permissions policy violation: unload is not allowed in this document.
350+
```
351+
316352
# [Self-Review Questionnaire: Security and Privacy](https://w3ctag.github.io/security-questionnaire/)
317353

318354
01. What information might this feature expose to Web sites or other parties,

0 commit comments

Comments
 (0)