diff --git a/index.html b/index.html index fe85908..cdb158c 100644 --- a/index.html +++ b/index.html @@ -5,10 +5,10 @@
Sec-Browsing-Topics
` HTTP request header
- Sec-Browsing-Topics
header
- Observe-Browsing-Topics
` HTTP response header
- Sec-Browsing-Topics
` HTTP request header
+ Sec-Browsing-Topics
header
+ Observe-Browsing-Topics
` HTTP response header
+ Given a list of topics history entries historyEntriesForUserTopics, the browser should provide an algorithm to derive top 5 topics, that are believed to be valuable for the Topics callers. The algorithm should return a list of 5 topic ids.
+Given a list of topics history entries historyEntriesForUserTopics:
+Let topicsCount be an empty map.
+For each topics history entry historyEntry in historyEntriesForUserTopics:
+Let topicIds be the result of classifying historyEntry’s topics calculation input data.
+For each topicId in topicIds:
+If topicsCount[topicId] does not exist:
+Initialize topicsCount[topicId] to 0.
+Increment topicsCount[topicId] by 1.
+Let top5Topics be a list containing the top up to 5 topicIds in topicsCount’s keys, where the topicIds with more count are retrieved first.
+If top5Topics has less than 5 entries:
+Pad top5Topics with random topic ids from user agent’s taxonomy, until top5Topics has 5 entries.
+Return top5Topics.
+At the start of a browser session, run the schedule user topics calculation algorithm.
If either user agent’s model or taxonomy isn’t available:
+If either user agent’s model or taxonomy isn’t available:
Let epoch be an epoch struct with default initial field values.
@@ -998,7 +1042,7 @@For each topics history entry topicsHistoryEntry in user agent’s topics history storage:
+For each topics history entry topicsHistoryEntry in user agent’s topics history storage:
Let visitTime be topicsHistoryEntry’s time.
If visitTime is before topicsCallerDataStartTime, then continue.
Classify topicsHistoryEntry’s topics calculation input data into topicIds.
+Let topicIds be the result of classifying topicsHistoryEntry’s topics calculation input data.
+If visitTime is greater than userTopicsDataStartTime:
+Append topicsHistoryEntry to historyEntriesForUserTopics.
+For each topicId in topicIds:
If topicsCount[topicId] does not exist:
-Initialize topicsCount[topicId] to 0.
+Initialize topicsCallers[topicId] to be an empty list.
For each callerOrigin in topicsHistoryEntry’s topics caller origins:
Append callerOrigin to topicsCallers[topicId].
-If visitTime is greater than userTopicsDataStartTime:
-Increment topicsCount[topicId] by 1.
+Append callerOrigin to topicsCallers[topicId].
Let top5Topics be a list containing the top up to 5 topicIds in topicsCount’s keys set, where the topicIds with more count are retrieved first.
-If top5Topics has less than 5 entries:
-Pad top5Topics with random topic ids from user agent’s taxonomy, until top5Topics has 5 entries.
-Let top5Topics be the result of running derive top 5 topics algorithm, given historyEntriesForUserTopics.
Let top5TopicsWithCallerOrigins be an empty list.
+Let top5TopicsWithCallerOrigins be an empty list.
For each topTopicId in top5Topics:
Append topicWithCallerOrigins to top5TopicsWithCallerOrigins.
Let epoch be an epoch struct with default initial field values.
@@ -1096,21 +1128,21 @@Append epoch to user agent’s user topics state's epochs.
+Append epoch to user agent’s user topics state's epochs.
If user agent’s user topics state's epochs has more than 4 entries, remove the oldest epoch.
Schedule this calculate user topics algorithm to run at Unix epoch + fromUnixEpochTime + (a duration of 7 days).
Let epochs be user agent’s user topics state's epochs.
If epochs is empty, then return an empty list.
+If epochs is empty, then return an empty list.
Let numEpochs be epochs’s size.
Let timestamp be callerContext’s timestamp.
Let result be an empty list.
+Let result be an empty list.
Let startEpochIndex be -1.
Set startEpochIndex to max(numEpochs − 1, 0).
+Set startEpochIndex to max(numEpochs − 3, 0).
Set endEpochIndex to numEpochs − 1.
BrowsingTopic
s.
Let epochs be the result of running the calculate the epochs for caller algorithm given callerContext as input.
Let result be an empty list.
+Let result be an empty list.
For each epoch in epochs:
The Topics API lives under the Document
interface, and is only available if the document is in secure context.
dictionary {
BrowsingTopicsOptions boolean =
skipObservation false ; @@ -1342,49 +1374,49 @@
fetch()
requests and for iframe navigation requests. The response header for a topics related request can specify whether the caller should to be recorded.
- TODO: make the modification directly to the fetch spec.
-browsingtopics
content attribute. The IDL attribute browsingTopics
reflects the browsingtopics
content attribute.
partial interface HTMLIFrameElement { [CEReactions ]attribute boolean browsingTopics ; };
TODO: make the modification directly to the html spec.
-partial dictionary RequestInit {boolean ; };
browsingTopics
TODO: make the modification directly to the fetch spec.
-If init["browsingTopics
"] exists, then set request’s send browsing topics header boolean to it.
TODO: make the modification directly to the fetch spec.
-If navigable’s container is an iframe
element, and if it has a browsingtopics
content attribute, then set request’s send browsing topics header boolean to true.
TODO: make the modification directly to the html spec.
-Sec-Browsing-Topics
` HTTP request headerSec-Browsing-Topics
` HTTP request headerThis specification defines a `Sec-Browsing-Topics
` HTTP request header. It is used to send the topics.
Append or modify a request `Sec-Browsing-Topics
` header for httpRequest.
TODO: make the modification directly to the fetch spec.
-Sec-Browsing-Topics
headerSec-Browsing-Topics
headerSec-Browsing-Topics
` header, given a request request, run these steps:
Let topicMaxLength be number of base-10 digits in the maximum topic id (e.g. for Chrome’s initial taxonomy, topicMaxLength is 3, as the topic id has maximum 3 digits).
Let versionMaxLength be the length of the current maximum version string length.
(100);v=chrome.1:1:20, (200);v=chrome.1:1:40, (300);v=chrome.1:1:60, ();p=P
Why adding paddings: servers typically have a GET request size limit e.g. 8KB, and will return an error when the limit is reached. An attacker can rely this to learn the number of topics for a different origin, and/or a small amount of information about the topics themselves (e.g whether the topic ids are < 10, < 100, etc.)
+Why adding paddings: servers typically have a GET request size limit e.g. 8KB, and will return an error when the limit is reached. An attacker can rely this to learn the number of topics for a different origin, and/or a small amount of information about the topics themselves (e.g whether the topic ids are < 10, < 100, etc.)
The various lengths being returned (that depends on the number of distinct versions) could leak which epochs the user had disabled topics or didn’t use the browser, if it coincided with the version change. But this leak is minor. The most common cases (i.e. returning same version topics, or no topics) will have the same length.
Observe-Browsing-Topics
` HTTP response headerObserve-Browsing-Topics
` HTTP response headerThe `Observe-Browsing-Topics
` HTTP response header can be used to record a caller’s topics observation.
This specification defines a policy-controlled feature identified by the string
"browsing-topics
". Its default allowlist is *
.
For backward compatibility, this specification also defines a policy-controlled feature identified by the string
"interest-cohort
". Its default allowlist is *
.
The Topics API attempts to provide just enough relevant interest information for advertisers to be able to personalize their ads for the user while maintaining user privacy. Some privacy safeguards include: usage in secure contexts only, topic limitation to a human curated taxonomy, different topics given to different sites in the same epoch to prevent cross-site reidentification, noised topics, a limited number of topics provided per epoch, user opt outs, site opt outs, and a suggestion that user agents provide UX to give users choice in which Topics are returned.