Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow all HTML attributionsrc surfaces to make multiple background requests #744

Merged
merged 2 commits into from
Apr 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 17 additions & 10 deletions EVENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,23 @@ window.open(
attributionsrc="https://adtech.example/attribution_source?my_ad_id=123">
```

Specifying a URL value for `attributionsrc` within `<a>`, `<img>`, `<script>` or
`window.open` will cause the browser to initiate a separate `keepalive` fetch
request which includes the `Attribution-Reporting-Eligible` request header.

When the `attributionsrc` attribute is present in these surfaces/APIs, both with
and without a value, existing requests made via `src`/`href` attributes or
`window.open` will now include the `Attribution-Reporting-Eligible` request
header. Each of these requests will be able to register attribution sources.

`event` sources can also be registered using existing JavaScript request
The `attributionsrc` attribute on `<a>`, `<img>`, and `<script>` may be empty or
non-empty. If it is non-empty, it contains a space-separated list of URLs
to which the browser will initiate a separate `keepalive` fetch request in the
background. If it is empty, no background requests will be made. In both
cases, the request(s) (originating from `href`, `src`, or `attributionsrc`) will
contain an `Attribution-Reporting-Eligible` header that indicates the types of
registrations that are allowed in the response.
apasel422 marked this conversation as resolved.
Show resolved Hide resolved

For `<a>` and `window.open`, background requests, if any, are made when the user
navigates. For `<img>` and `<script>`, background requests are made when the
`attributionsrc` attribute is set on the DOM element.

In JavaScript, `window.open` also supports an empty or non-empty
`attributionsrc` feature, though it **does not yet support multiple values** due
to complexity in parsing the feature string.

`event` sources can also be registered using existing JavaScript request
APIs by setting the `Attribution-Reporting-Eligible` header manually:

```javascript
Expand Down