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

Proposal for retrieving and observing topics via headers #81

Merged
merged 6 commits into from
Sep 27, 2022

Conversation

jkarlin
Copy link
Collaborator

@jkarlin jkarlin commented Jul 15, 2022

As discussed in #7

README.md Outdated Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@jkarlin jkarlin merged commit 838bd93 into main Sep 27, 2022
@zhengweiwithoutthei
Copy link

This is exciting! Thanks. Two questions:

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

@jkarlin
Copy link
Collaborator Author

jkarlin commented Sep 28, 2022

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
Copy link

domenic commented Sep 28, 2022

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 <[email protected]>
Reviewed-by: Avi Drissman <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
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 <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Reviewed-by: Adithya Srinivasan <[email protected]>
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 <[email protected]>
Reviewed-by: John Delaney <[email protected]>
Reviewed-by: Mike West <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
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 <[email protected]>
Reviewed-by: Matt Menke <[email protected]>
Reviewed-by: Josh Karlin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1074178}
@zhengweiwithoutthei
Copy link

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 <[email protected]>
Reviewed-by: Rakina Zata Amni <[email protected]>
Reviewed-by: Mike West <[email protected]>
Reviewed-by: Josh Karlin <[email protected]>
Commit-Queue: Yao Xiao <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1088426}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants