Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Proposal for retrieving and observing topics via headers#81

Merged
jkarlin merged 6 commits into
mainfrom
jkarlin-patch-1-headers
Sep 27, 2022
Merged

Proposal for retrieving and observing topics via headers#81
jkarlin merged 6 commits into
mainfrom
jkarlin-patch-1-headers

Conversation

@jkarlin

@jkarlin jkarlin commented Jul 15, 2022

Copy link
Copy Markdown
Collaborator

As discussed in #7

Comment thread README.md Outdated
Comment thread README.md
Comment thread README.md Outdated
@jkarlin jkarlin merged commit 838bd93 into main Sep 27, 2022
@zhengweiwithoutthei

Copy link
Copy Markdown

This is exciting! Thanks. Two questions:

  1. Is there a support for Xhr API?
  2. What Chrome version this change will be included?

@jkarlin

jkarlin commented Sep 28, 2022

Copy link
Copy Markdown
Collaborator Author

Yes, it makes sense to add XHR if we have fetch. I'll clarify. We're targeting M108 for these changes, but no guarantees.

@domenic

domenic commented Sep 28, 2022

Copy link
Copy Markdown

Actually, there's general cross-browser agreement to not add any new capabilities to XHR...

aarongable pushed a commit to chromium/chromium that referenced this pull request Oct 26, 2022
…HandleTopicsWebApi()

The fetch() & navigation headers proposal
(patcg-individual-drafts/topics#81) requires
the request to distinguish between permission disallowed by
settings v.s. empty topics, so that the request is considered to
be "topic eligible" only when the permission was allowed. Besides,
they want to "get" and "set" topics at different time. Thus, this
CL introduces & switches to the more general
BrowsingTopicsService::HandleTopicsWebApi() API.

Bug: 1352345
Change-Id: Ife4790f7a0b821cd38f2c51049de17d19113677a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3964989
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1063792}
aarongable pushed a commit to chromium/chromium that referenced this pull request Nov 4, 2022
Add 1) a method to convert topics to header string, and 2) a method to
check response headers and store the observation. Those methods will be
used for handling both fetch() and navigation topics headers.

PR: patcg-individual-drafts/topics#81

A preview of how the methods will be integrated:
https://crrev.com/c/3978874

Bug: 1378433
Change-Id: I5586a5362ded124f1c2e2904735b290866a1a10c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3989110
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Adithya Srinivasan <adithyas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1067625}
aarongable pushed a commit to chromium/chromium that referenced this pull request Nov 8, 2022
Introduce IDL field: RequestInit::browsingTopics for fetch(), and plumb
it to network::ResourceRequest.

PR: patcg-individual-drafts/topics#81
A preview of how things will be integrated: https://crrev.com/c/3978874

Bug: 1378433
Change-Id: I4c79967d90dcbc5810d35a6f08b4c27a784d1863
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3990619
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: John Delaney <johnidel@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1068764}
aarongable pushed a commit to chromium/chromium that referenced this pull request Nov 21, 2022
Introduce BrowsingTopicsURLLoader & Service to intercept
fetch(<url>, {browsingTopics: true}) request in the browser process.

PR: patcg-individual-drafts/topics#81

Design doc: https://docs.google.com/document/d/1bBuaJSIhfm-r51BDG8v_0UJnnS2yk7_b6IzAE0jPpTo/edit?resourcekey=0-_JQTIIxqAzoZ4nW_j3yoig#heading=h.7cfn3y7i0qjn

POC code: https://crrev.com/c/3978874

Bug: 1378433
Change-Id: Ifb8d4ca63dcdee1f1c0025f9530dab7b3373a8b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4000440
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Reviewed-by: Matt Menke <mmenke@chromium.org>
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1074178}
@zhengweiwithoutthei

Copy link
Copy Markdown

Will there be a support for WebBundle? Repeating myself #7 (comment) :)

aarongable pushed a commit to chromium/chromium that referenced this pull request Jan 3, 2023
Use topics loader factory to proxy fetch(<url>, {browsingTopics: true})
requests via the browser process:
- (browser) On navigation commit, create the factory and pass it to the
  renderer.
- (renderer) For topics related request, use this factory.

Also, move the service worker tests from
privacy_sandbox_ads_apis_browsertest to browsing_topics_browsertest:
for SW, the topics eligibility & header visibility are disabled
regardless of OT status, thus it makes more sense to test it in a
different test suite.

Also, require [Exposed=Window] for the browsingTopics attribute. This
has no web visible effect (i.e. for workers, topics would still be
disabled due to 1) OT framework only works in Window context; 2) we’d
only pass a valid `topics_loader_factory` to the Window context). But
this would make ResourceRequest::browsing_topics false, so it's
consistent with the intended scope.

PR: patcg-individual-drafts/topics#81

Design doc: https://docs.google.com/document/d/1bBuaJSIhfm-r51BDG8v_0UJnnS2yk7_b6IzAE0jPpTo/edit?resourcekey=0-_JQTIIxqAzoZ4nW_j3yoig#heading=h.7cfn3y7i0qjn

Fuchsia-Binary-Size: Size increase is unavoidable.
Bug: 1378433
Change-Id: Ie5cf33d0982b29cb422e587855af4e352c0732ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4044267
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: Rakina Zata Amni <rakina@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Reviewed-by: Josh Karlin <jkarlin@chromium.org>
Commit-Queue: Yao Xiao <yaoxia@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1088426}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants