Skip to content

Commit

Permalink
Move lifetime to IG attribute (#870)
Browse files Browse the repository at this point in the history
* Move lifetime to IG attribute

* fix duration mention
  • Loading branch information
JensenPaul authored Oct 24, 2023
1 parent 919f106 commit 503311e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions FLEDGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ Browsers keep track of the set of interest groups that they have joined. For ea
const myGroup = {
'owner': 'https://www.example-dsp.com',
'name': 'womens-running-shoes',
'lifetimeMs': 30 * kMillisecsPerDay,
'priority': 0.0,
'priorityVector': {
'signal1': 2,
Expand All @@ -123,7 +124,7 @@ const myGroup = {
'adComponents': [runningShoes1, runningShoes2, gymShoes, gymTrainers1, gymTrainers2],
'auctionServerRequestFlags': ['omit-ads'],
};
const joinPromise = navigator.joinAdInterestGroup(myGroup, 30 * kSecsPerDay);
const joinPromise = navigator.joinAdInterestGroup(myGroup);
```


Expand All @@ -135,7 +136,7 @@ There is a complementary API `navigator.leaveAdInterestGroup(myGroup)` which loo

There is a related API `navigator.clearOriginJoinedAdInterestGroups(owner, [<groupNamesToKeep>])` that leaves all interest groups owned by `owner` that were joined on the current top-level frame's origin, and also returns a Promise. The `[<groupNamesToKeep>]` argument is an optional list of interest group names that will not be left, and if not present, it will act as if an empty array was passed. This method has no effect on joined interest groups owned by `owner` that were most recently joined on different top-level origins.

The browser will remain in an interest group for only a limited amount of time. The duration, in seconds, is specified in the call to `joinAdInterestGroup()`, and will be capped at 30 days. This can be extended by calling `joinAdInterestGroup()` again later, with the same group name and owner. Successive calls to `joinAdInterestGroup()` will overwrite the previously-stored values for any interest group properties, like the group's `userBiddingSignal` or list of ads. A duration <= 0 will leave the interest group.
The browser will remain in an interest group for only a limited amount of time. The duration, in milliseconds, is specified in the `lifetimeMs` attribute of the interest group, and will be capped at 30 days. This can be extended by calling `joinAdInterestGroup()` again later, with the same group name and owner. Successive calls to `joinAdInterestGroup()` will overwrite the previously-stored values for any interest group properties, like the group's `userBiddingSignal` or list of ads. A duration <= 0 will leave the interest group.

#### 1.2 Interest Group Attributes

Expand Down Expand Up @@ -247,7 +248,7 @@ When a frame navigated to one domain calls joinAdInterestGroup(), leaveAdInteres
}
```

Indicating whether the origin in the path has permissions to join and/or leave interest groups owned by the domain the request is sent to. Missing permissions are assumed to be false. Since calling `navigator.joinAdInterestGroup()` with a duration of 0 effectively leaves an interest group, `joinAdInterestGroup: true` also allows an origin to call navigator.leaveAdInterestGroup(), even if `leaveadInterestGroup` is missing or is set to false. Note that both `leaveAdInterestGroup()` and `clearOriginJoinedAdInterestGroups()` check the "leaveAdInterestGroup" permission.
Indicating whether the origin in the path has permissions to join and/or leave interest groups owned by the domain the request is sent to. Missing permissions are assumed to be false. Since calling `navigator.joinAdInterestGroup()` with a `lifetimeMs` of 0 effectively leaves an interest group, `joinAdInterestGroup: true` also allows an origin to call navigator.leaveAdInterestGroup(), even if `leaveadInterestGroup` is missing or is set to false. Note that both `leaveAdInterestGroup()` and `clearOriginJoinedAdInterestGroups()` check the "leaveAdInterestGroup" permission.

Since joining or leaving a group may depend on a network request, browsers may delay these requests, or run them out of order. Each frame must, however, run all pending joins and leaves for a single owner in the order in which they were made. Same-origin operations should be applied immediately. When a page or frame is navigated, the browser should make a best-effort attempt to complete pending join and leave operations that are blocked on a network fetch, but may choose to drop them if there are more than 20 for a single top-level frame. This is intended to allow joining or leaving a cross-origin interest group at the same time as starting a navigation in response to a user gesture, though previous join/leave calls may still cause such an operation to be dropped.

Expand Down

0 comments on commit 503311e

Please sign in to comment.