blob: fde8c372e950515e17a7d4fcc595549778133406 [file] [log] [blame]
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Partial Navigator interface for ad-serving experiments.
// FLEDGE: https://github.com/WICG/turtledove/blob/main/FLEDGE.md
// PARAKEET:
// https://github.com/WICG/privacy-preserving-ads/blob/main/Parakeet.md
// Common interest group APIs are behind AdInterestGroupAPI and specific ad
// serving APIs are behing Fledge and Parakeet respectively.
typedef (USVString or FencedFrameConfig) UrnOrConfig;
[
ImplementedAs=NavigatorAuction,
RuntimeEnabled=AdInterestGroupAPI,
SecureContext
] partial interface Navigator {
[CallWith=ScriptState, Measure, RaisesException]
Promise<void> joinAdInterestGroup(AuctionAdInterestGroup group, double durationSeconds);
[CallWith=ScriptState, Measure, RaisesException]
Promise<void> leaveAdInterestGroup(optional AuctionAdInterestGroupKey group);
[CallWith=ScriptState, Measure, RaisesException]
void updateAdInterestGroups();
[RuntimeEnabled=Fledge, CallWith=ScriptState, Measure, RaisesException]
Promise<UrnOrConfig?> runAdAuction(AuctionAdConfig config);
[RuntimeEnabled=Fledge, CallWith=ScriptState, Measure, RaisesException]
sequence<USVString> adAuctionComponents([Clamp] unsigned short numComponents);
[RuntimeEnabled=AllowURNsInIframes, CallWith=ScriptState, Measure, RaisesException]
Promise<USVString> deprecatedURNToURL(UrnOrConfig urn_or_config, optional boolean send_reports = false);
[RuntimeEnabled=AllowURNsInIframes, CallWith=ScriptState, Measure, RaisesException]
Promise<void> deprecatedReplaceInURN(UrnOrConfig urn_or_config, record<USVString, USVString> replacements);
[RuntimeEnabled=FledgeBiddingAndAuctionServer, CallWith=ScriptState, Measure, RaisesException]
Promise<Uint8Array> getInterestGroupAdAuctionData(AdAuctionDataConfig config);
[RuntimeEnabled=Parakeet, CallWith=ScriptState, Measure, RaisesException]
Promise<Ads> createAdRequest(AdRequestConfig config);
[RuntimeEnabled=Parakeet, CallWith=ScriptState, Measure, RaisesException]
Promise<URL> finalizeAd(Ads ads, AuctionAdConfig config);
[RuntimeEnabled=FencedFrames, CallWith=ScriptState]
boolean canLoadAdAuctionFencedFrame();
};