Skip to content

Commit

Permalink
Add section on force-load-at-top document policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Burris authored Apr 30, 2020
1 parent c7ed40e commit ce38edc
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ parts of pages are addressable by named anchors or elements with ids.
### Current Status

This feature, as currently [specified in this repo](https://wicg.github.io/ScrollToTextFragment),
is shipping to stable channel in Chrome M80. To opt out of text fragments,
websites can register for the [ForceLoadAtTop origin trial](https://developers.chrome.com/origintrials/#/view_trial/3253850730775183361),
is shipping to stable channel in Chrome M80.

To opt out of text fragments, a [force-load-at-top Document Policy](#opting-out)
will be available once document policies have shipped. In the meantime, websites
can register for the [ForceLoadAtTop origin trial](https://developers.chrome.com/origintrials/#/view_trial/3253850730775183361),
which will ensure that no scrolling happens on page load, including via regular
fragment anchors and scroll restoration. For details on how to register a
website for an origin trial, see the [Origin Trials Guide for Web Developers](https://github.com/GoogleChrome/OriginTrials/blob/gh-pages/developer-guide.md).
Expand Down Expand Up @@ -509,6 +512,18 @@ Visual emphasis is performed using a visual-only indicator (i.e. don’t cause
selection), styled by the UA and undetectable from script. This helps prevents
drag-and-drop or copy-paste attacks.

### Opting Out

To allow websites to opt out of text fragments, we propose adding a [Document
Policy](https://github.com/w3c/webappsec-feature-policy/blob/master/document-policy-explainer.md)
named force-load-at-top that ensures the page is loaded without any form of
scrolling, including via text fragments, regular element fragments, and scroll
restoration. Websites can use this document policy by serving the HTTP header:

```
Document-Policy: force-load-at-top
```

## Alternatives Considered

### Text Fragment Directive 0.1
Expand Down

0 comments on commit ce38edc

Please sign in to comment.