这是indexloc提供的服务,不要输入任何密码
Skip to content
This repository was archived by the owner on Mar 14, 2024. It is now read-only.

Added skipObservation to Topics article #4280

Merged
merged 3 commits into from
Nov 17, 2022
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
11 changes: 11 additions & 0 deletions site/en/docs/privacy-sandbox/topics/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,17 @@ the [API caller](#caller) has previously observed, and the number of topics that
available (such as the number of weeks of data accumulated). Anywhere from zero to three topics may
be returned.

{: #skipobservation}

{% Aside %}
From Chrome 108, the `document.browsingTopics()` method can be passed an optional `{skipObservation:true}`
argument.

This allows the method to return topics without causing the browser to record
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call @heyawhite! Thanks for the review.

a topic observation (the default is `false`). In other words, `document.browsingTopics({skipObservation:true})`
can be used to return topics of interest for the current user, but with no side effects.
{% endAside %}

### Access topics with the JavaScript API {: #access-topics}

Here is a basic example of possible API usage to access topics for the current user. To keep it simple, there's no error handling.
Expand Down