storage.go 41 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170
  1. // Package storage provides the Chrome DevTools Protocol
  2. // commands, types, and events for the Storage domain.
  3. //
  4. // Generated by the cdproto-gen command.
  5. package storage
  6. // Code generated by cdproto-gen. DO NOT EDIT.
  7. import (
  8. "context"
  9. "github.com/chromedp/cdproto/cdp"
  10. "github.com/chromedp/cdproto/network"
  11. "github.com/go-json-experiment/json/jsontext"
  12. )
  13. // GetStorageKeyForFrameParams returns a storage key given a frame id.
  14. type GetStorageKeyForFrameParams struct {
  15. FrameID cdp.FrameID `json:"frameId"`
  16. }
  17. // GetStorageKeyForFrame returns a storage key given a frame id.
  18. //
  19. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getStorageKeyForFrame
  20. //
  21. // parameters:
  22. //
  23. // frameID
  24. func GetStorageKeyForFrame(frameID cdp.FrameID) *GetStorageKeyForFrameParams {
  25. return &GetStorageKeyForFrameParams{
  26. FrameID: frameID,
  27. }
  28. }
  29. // GetStorageKeyForFrameReturns return values.
  30. type GetStorageKeyForFrameReturns struct {
  31. StorageKey SerializedStorageKey `json:"storageKey,omitempty,omitzero"`
  32. }
  33. // Do executes Storage.getStorageKeyForFrame against the provided context.
  34. //
  35. // returns:
  36. //
  37. // storageKey
  38. func (p *GetStorageKeyForFrameParams) Do(ctx context.Context) (storageKey SerializedStorageKey, err error) {
  39. // execute
  40. var res GetStorageKeyForFrameReturns
  41. err = cdp.Execute(ctx, CommandGetStorageKeyForFrame, p, &res)
  42. if err != nil {
  43. return "", err
  44. }
  45. return res.StorageKey, nil
  46. }
  47. // ClearDataForOriginParams clears storage for origin.
  48. type ClearDataForOriginParams struct {
  49. Origin string `json:"origin"` // Security origin.
  50. StorageTypes string `json:"storageTypes"` // Comma separated list of StorageType to clear.
  51. }
  52. // ClearDataForOrigin clears storage for origin.
  53. //
  54. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-clearDataForOrigin
  55. //
  56. // parameters:
  57. //
  58. // origin - Security origin.
  59. // storageTypes - Comma separated list of StorageType to clear.
  60. func ClearDataForOrigin(origin string, storageTypes string) *ClearDataForOriginParams {
  61. return &ClearDataForOriginParams{
  62. Origin: origin,
  63. StorageTypes: storageTypes,
  64. }
  65. }
  66. // Do executes Storage.clearDataForOrigin against the provided context.
  67. func (p *ClearDataForOriginParams) Do(ctx context.Context) (err error) {
  68. return cdp.Execute(ctx, CommandClearDataForOrigin, p, nil)
  69. }
  70. // ClearDataForStorageKeyParams clears storage for storage key.
  71. type ClearDataForStorageKeyParams struct {
  72. StorageKey string `json:"storageKey"` // Storage key.
  73. StorageTypes string `json:"storageTypes"` // Comma separated list of StorageType to clear.
  74. }
  75. // ClearDataForStorageKey clears storage for storage key.
  76. //
  77. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-clearDataForStorageKey
  78. //
  79. // parameters:
  80. //
  81. // storageKey - Storage key.
  82. // storageTypes - Comma separated list of StorageType to clear.
  83. func ClearDataForStorageKey(storageKey string, storageTypes string) *ClearDataForStorageKeyParams {
  84. return &ClearDataForStorageKeyParams{
  85. StorageKey: storageKey,
  86. StorageTypes: storageTypes,
  87. }
  88. }
  89. // Do executes Storage.clearDataForStorageKey against the provided context.
  90. func (p *ClearDataForStorageKeyParams) Do(ctx context.Context) (err error) {
  91. return cdp.Execute(ctx, CommandClearDataForStorageKey, p, nil)
  92. }
  93. // GetCookiesParams returns all browser cookies.
  94. type GetCookiesParams struct {
  95. BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty,omitzero"` // Browser context to use when called on the browser endpoint.
  96. }
  97. // GetCookies returns all browser cookies.
  98. //
  99. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getCookies
  100. //
  101. // parameters:
  102. func GetCookies() *GetCookiesParams {
  103. return &GetCookiesParams{}
  104. }
  105. // WithBrowserContextID browser context to use when called on the browser
  106. // endpoint.
  107. func (p GetCookiesParams) WithBrowserContextID(browserContextID cdp.BrowserContextID) *GetCookiesParams {
  108. p.BrowserContextID = browserContextID
  109. return &p
  110. }
  111. // GetCookiesReturns return values.
  112. type GetCookiesReturns struct {
  113. Cookies []*network.Cookie `json:"cookies,omitempty,omitzero"` // Array of cookie objects.
  114. }
  115. // Do executes Storage.getCookies against the provided context.
  116. //
  117. // returns:
  118. //
  119. // cookies - Array of cookie objects.
  120. func (p *GetCookiesParams) Do(ctx context.Context) (cookies []*network.Cookie, err error) {
  121. // execute
  122. var res GetCookiesReturns
  123. err = cdp.Execute(ctx, CommandGetCookies, p, &res)
  124. if err != nil {
  125. return nil, err
  126. }
  127. return res.Cookies, nil
  128. }
  129. // SetCookiesParams sets given cookies.
  130. type SetCookiesParams struct {
  131. Cookies []*network.CookieParam `json:"cookies"` // Cookies to be set.
  132. BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty,omitzero"` // Browser context to use when called on the browser endpoint.
  133. }
  134. // SetCookies sets given cookies.
  135. //
  136. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-setCookies
  137. //
  138. // parameters:
  139. //
  140. // cookies - Cookies to be set.
  141. func SetCookies(cookies []*network.CookieParam) *SetCookiesParams {
  142. return &SetCookiesParams{
  143. Cookies: cookies,
  144. }
  145. }
  146. // WithBrowserContextID browser context to use when called on the browser
  147. // endpoint.
  148. func (p SetCookiesParams) WithBrowserContextID(browserContextID cdp.BrowserContextID) *SetCookiesParams {
  149. p.BrowserContextID = browserContextID
  150. return &p
  151. }
  152. // Do executes Storage.setCookies against the provided context.
  153. func (p *SetCookiesParams) Do(ctx context.Context) (err error) {
  154. return cdp.Execute(ctx, CommandSetCookies, p, nil)
  155. }
  156. // ClearCookiesParams clears cookies.
  157. type ClearCookiesParams struct {
  158. BrowserContextID cdp.BrowserContextID `json:"browserContextId,omitempty,omitzero"` // Browser context to use when called on the browser endpoint.
  159. }
  160. // ClearCookies clears cookies.
  161. //
  162. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-clearCookies
  163. //
  164. // parameters:
  165. func ClearCookies() *ClearCookiesParams {
  166. return &ClearCookiesParams{}
  167. }
  168. // WithBrowserContextID browser context to use when called on the browser
  169. // endpoint.
  170. func (p ClearCookiesParams) WithBrowserContextID(browserContextID cdp.BrowserContextID) *ClearCookiesParams {
  171. p.BrowserContextID = browserContextID
  172. return &p
  173. }
  174. // Do executes Storage.clearCookies against the provided context.
  175. func (p *ClearCookiesParams) Do(ctx context.Context) (err error) {
  176. return cdp.Execute(ctx, CommandClearCookies, p, nil)
  177. }
  178. // GetUsageAndQuotaParams returns usage and quota in bytes.
  179. type GetUsageAndQuotaParams struct {
  180. Origin string `json:"origin"` // Security origin.
  181. }
  182. // GetUsageAndQuota returns usage and quota in bytes.
  183. //
  184. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getUsageAndQuota
  185. //
  186. // parameters:
  187. //
  188. // origin - Security origin.
  189. func GetUsageAndQuota(origin string) *GetUsageAndQuotaParams {
  190. return &GetUsageAndQuotaParams{
  191. Origin: origin,
  192. }
  193. }
  194. // GetUsageAndQuotaReturns return values.
  195. type GetUsageAndQuotaReturns struct {
  196. Usage float64 `json:"usage,omitempty,omitzero"` // Storage usage (bytes).
  197. Quota float64 `json:"quota,omitempty,omitzero"` // Storage quota (bytes).
  198. OverrideActive bool `json:"overrideActive"` // Whether or not the origin has an active storage quota override
  199. UsageBreakdown []*UsageForType `json:"usageBreakdown,omitempty,omitzero"` // Storage usage per type (bytes).
  200. }
  201. // Do executes Storage.getUsageAndQuota against the provided context.
  202. //
  203. // returns:
  204. //
  205. // usage - Storage usage (bytes).
  206. // quota - Storage quota (bytes).
  207. // overrideActive - Whether or not the origin has an active storage quota override
  208. // usageBreakdown - Storage usage per type (bytes).
  209. func (p *GetUsageAndQuotaParams) Do(ctx context.Context) (usage float64, quota float64, overrideActive bool, usageBreakdown []*UsageForType, err error) {
  210. // execute
  211. var res GetUsageAndQuotaReturns
  212. err = cdp.Execute(ctx, CommandGetUsageAndQuota, p, &res)
  213. if err != nil {
  214. return 0, 0, false, nil, err
  215. }
  216. return res.Usage, res.Quota, res.OverrideActive, res.UsageBreakdown, nil
  217. }
  218. // OverrideQuotaForOriginParams override quota for the specified origin.
  219. type OverrideQuotaForOriginParams struct {
  220. Origin string `json:"origin"` // Security origin.
  221. QuotaSize float64 `json:"quotaSize,omitempty,omitzero"` // The quota size (in bytes) to override the original quota with. If this is called multiple times, the overridden quota will be equal to the quotaSize provided in the final call. If this is called without specifying a quotaSize, the quota will be reset to the default value for the specified origin. If this is called multiple times with different origins, the override will be maintained for each origin until it is disabled (called without a quotaSize).
  222. }
  223. // OverrideQuotaForOrigin override quota for the specified origin.
  224. //
  225. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-overrideQuotaForOrigin
  226. //
  227. // parameters:
  228. //
  229. // origin - Security origin.
  230. func OverrideQuotaForOrigin(origin string) *OverrideQuotaForOriginParams {
  231. return &OverrideQuotaForOriginParams{
  232. Origin: origin,
  233. }
  234. }
  235. // WithQuotaSize the quota size (in bytes) to override the original quota
  236. // with. If this is called multiple times, the overridden quota will be equal to
  237. // the quotaSize provided in the final call. If this is called without
  238. // specifying a quotaSize, the quota will be reset to the default value for the
  239. // specified origin. If this is called multiple times with different origins,
  240. // the override will be maintained for each origin until it is disabled (called
  241. // without a quotaSize).
  242. func (p OverrideQuotaForOriginParams) WithQuotaSize(quotaSize float64) *OverrideQuotaForOriginParams {
  243. p.QuotaSize = quotaSize
  244. return &p
  245. }
  246. // Do executes Storage.overrideQuotaForOrigin against the provided context.
  247. func (p *OverrideQuotaForOriginParams) Do(ctx context.Context) (err error) {
  248. return cdp.Execute(ctx, CommandOverrideQuotaForOrigin, p, nil)
  249. }
  250. // TrackCacheStorageForOriginParams registers origin to be notified when an
  251. // update occurs to its cache storage list.
  252. type TrackCacheStorageForOriginParams struct {
  253. Origin string `json:"origin"` // Security origin.
  254. }
  255. // TrackCacheStorageForOrigin registers origin to be notified when an update
  256. // occurs to its cache storage list.
  257. //
  258. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-trackCacheStorageForOrigin
  259. //
  260. // parameters:
  261. //
  262. // origin - Security origin.
  263. func TrackCacheStorageForOrigin(origin string) *TrackCacheStorageForOriginParams {
  264. return &TrackCacheStorageForOriginParams{
  265. Origin: origin,
  266. }
  267. }
  268. // Do executes Storage.trackCacheStorageForOrigin against the provided context.
  269. func (p *TrackCacheStorageForOriginParams) Do(ctx context.Context) (err error) {
  270. return cdp.Execute(ctx, CommandTrackCacheStorageForOrigin, p, nil)
  271. }
  272. // TrackCacheStorageForStorageKeyParams registers storage key to be notified
  273. // when an update occurs to its cache storage list.
  274. type TrackCacheStorageForStorageKeyParams struct {
  275. StorageKey string `json:"storageKey"` // Storage key.
  276. }
  277. // TrackCacheStorageForStorageKey registers storage key to be notified when
  278. // an update occurs to its cache storage list.
  279. //
  280. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-trackCacheStorageForStorageKey
  281. //
  282. // parameters:
  283. //
  284. // storageKey - Storage key.
  285. func TrackCacheStorageForStorageKey(storageKey string) *TrackCacheStorageForStorageKeyParams {
  286. return &TrackCacheStorageForStorageKeyParams{
  287. StorageKey: storageKey,
  288. }
  289. }
  290. // Do executes Storage.trackCacheStorageForStorageKey against the provided context.
  291. func (p *TrackCacheStorageForStorageKeyParams) Do(ctx context.Context) (err error) {
  292. return cdp.Execute(ctx, CommandTrackCacheStorageForStorageKey, p, nil)
  293. }
  294. // TrackIndexedDBForOriginParams registers origin to be notified when an
  295. // update occurs to its IndexedDB.
  296. type TrackIndexedDBForOriginParams struct {
  297. Origin string `json:"origin"` // Security origin.
  298. }
  299. // TrackIndexedDBForOrigin registers origin to be notified when an update
  300. // occurs to its IndexedDB.
  301. //
  302. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-trackIndexedDBForOrigin
  303. //
  304. // parameters:
  305. //
  306. // origin - Security origin.
  307. func TrackIndexedDBForOrigin(origin string) *TrackIndexedDBForOriginParams {
  308. return &TrackIndexedDBForOriginParams{
  309. Origin: origin,
  310. }
  311. }
  312. // Do executes Storage.trackIndexedDBForOrigin against the provided context.
  313. func (p *TrackIndexedDBForOriginParams) Do(ctx context.Context) (err error) {
  314. return cdp.Execute(ctx, CommandTrackIndexedDBForOrigin, p, nil)
  315. }
  316. // TrackIndexedDBForStorageKeyParams registers storage key to be notified
  317. // when an update occurs to its IndexedDB.
  318. type TrackIndexedDBForStorageKeyParams struct {
  319. StorageKey string `json:"storageKey"` // Storage key.
  320. }
  321. // TrackIndexedDBForStorageKey registers storage key to be notified when an
  322. // update occurs to its IndexedDB.
  323. //
  324. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-trackIndexedDBForStorageKey
  325. //
  326. // parameters:
  327. //
  328. // storageKey - Storage key.
  329. func TrackIndexedDBForStorageKey(storageKey string) *TrackIndexedDBForStorageKeyParams {
  330. return &TrackIndexedDBForStorageKeyParams{
  331. StorageKey: storageKey,
  332. }
  333. }
  334. // Do executes Storage.trackIndexedDBForStorageKey against the provided context.
  335. func (p *TrackIndexedDBForStorageKeyParams) Do(ctx context.Context) (err error) {
  336. return cdp.Execute(ctx, CommandTrackIndexedDBForStorageKey, p, nil)
  337. }
  338. // UntrackCacheStorageForOriginParams unregisters origin from receiving
  339. // notifications for cache storage.
  340. type UntrackCacheStorageForOriginParams struct {
  341. Origin string `json:"origin"` // Security origin.
  342. }
  343. // UntrackCacheStorageForOrigin unregisters origin from receiving
  344. // notifications for cache storage.
  345. //
  346. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-untrackCacheStorageForOrigin
  347. //
  348. // parameters:
  349. //
  350. // origin - Security origin.
  351. func UntrackCacheStorageForOrigin(origin string) *UntrackCacheStorageForOriginParams {
  352. return &UntrackCacheStorageForOriginParams{
  353. Origin: origin,
  354. }
  355. }
  356. // Do executes Storage.untrackCacheStorageForOrigin against the provided context.
  357. func (p *UntrackCacheStorageForOriginParams) Do(ctx context.Context) (err error) {
  358. return cdp.Execute(ctx, CommandUntrackCacheStorageForOrigin, p, nil)
  359. }
  360. // UntrackCacheStorageForStorageKeyParams unregisters storage key from
  361. // receiving notifications for cache storage.
  362. type UntrackCacheStorageForStorageKeyParams struct {
  363. StorageKey string `json:"storageKey"` // Storage key.
  364. }
  365. // UntrackCacheStorageForStorageKey unregisters storage key from receiving
  366. // notifications for cache storage.
  367. //
  368. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-untrackCacheStorageForStorageKey
  369. //
  370. // parameters:
  371. //
  372. // storageKey - Storage key.
  373. func UntrackCacheStorageForStorageKey(storageKey string) *UntrackCacheStorageForStorageKeyParams {
  374. return &UntrackCacheStorageForStorageKeyParams{
  375. StorageKey: storageKey,
  376. }
  377. }
  378. // Do executes Storage.untrackCacheStorageForStorageKey against the provided context.
  379. func (p *UntrackCacheStorageForStorageKeyParams) Do(ctx context.Context) (err error) {
  380. return cdp.Execute(ctx, CommandUntrackCacheStorageForStorageKey, p, nil)
  381. }
  382. // UntrackIndexedDBForOriginParams unregisters origin from receiving
  383. // notifications for IndexedDB.
  384. type UntrackIndexedDBForOriginParams struct {
  385. Origin string `json:"origin"` // Security origin.
  386. }
  387. // UntrackIndexedDBForOrigin unregisters origin from receiving notifications
  388. // for IndexedDB.
  389. //
  390. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-untrackIndexedDBForOrigin
  391. //
  392. // parameters:
  393. //
  394. // origin - Security origin.
  395. func UntrackIndexedDBForOrigin(origin string) *UntrackIndexedDBForOriginParams {
  396. return &UntrackIndexedDBForOriginParams{
  397. Origin: origin,
  398. }
  399. }
  400. // Do executes Storage.untrackIndexedDBForOrigin against the provided context.
  401. func (p *UntrackIndexedDBForOriginParams) Do(ctx context.Context) (err error) {
  402. return cdp.Execute(ctx, CommandUntrackIndexedDBForOrigin, p, nil)
  403. }
  404. // UntrackIndexedDBForStorageKeyParams unregisters storage key from receiving
  405. // notifications for IndexedDB.
  406. type UntrackIndexedDBForStorageKeyParams struct {
  407. StorageKey string `json:"storageKey"` // Storage key.
  408. }
  409. // UntrackIndexedDBForStorageKey unregisters storage key from receiving
  410. // notifications for IndexedDB.
  411. //
  412. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-untrackIndexedDBForStorageKey
  413. //
  414. // parameters:
  415. //
  416. // storageKey - Storage key.
  417. func UntrackIndexedDBForStorageKey(storageKey string) *UntrackIndexedDBForStorageKeyParams {
  418. return &UntrackIndexedDBForStorageKeyParams{
  419. StorageKey: storageKey,
  420. }
  421. }
  422. // Do executes Storage.untrackIndexedDBForStorageKey against the provided context.
  423. func (p *UntrackIndexedDBForStorageKeyParams) Do(ctx context.Context) (err error) {
  424. return cdp.Execute(ctx, CommandUntrackIndexedDBForStorageKey, p, nil)
  425. }
  426. // GetTrustTokensParams returns the number of stored Trust Tokens per issuer
  427. // for the current browsing context.
  428. type GetTrustTokensParams struct{}
  429. // GetTrustTokens returns the number of stored Trust Tokens per issuer for
  430. // the current browsing context.
  431. //
  432. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getTrustTokens
  433. func GetTrustTokens() *GetTrustTokensParams {
  434. return &GetTrustTokensParams{}
  435. }
  436. // GetTrustTokensReturns return values.
  437. type GetTrustTokensReturns struct {
  438. Tokens []*TrustTokens `json:"tokens,omitempty,omitzero"`
  439. }
  440. // Do executes Storage.getTrustTokens against the provided context.
  441. //
  442. // returns:
  443. //
  444. // tokens
  445. func (p *GetTrustTokensParams) Do(ctx context.Context) (tokens []*TrustTokens, err error) {
  446. // execute
  447. var res GetTrustTokensReturns
  448. err = cdp.Execute(ctx, CommandGetTrustTokens, nil, &res)
  449. if err != nil {
  450. return nil, err
  451. }
  452. return res.Tokens, nil
  453. }
  454. // ClearTrustTokensParams removes all Trust Tokens issued by the provided
  455. // issuerOrigin. Leaves other stored data, including the issuer's Redemption
  456. // Records, intact.
  457. type ClearTrustTokensParams struct {
  458. IssuerOrigin string `json:"issuerOrigin"`
  459. }
  460. // ClearTrustTokens removes all Trust Tokens issued by the provided
  461. // issuerOrigin. Leaves other stored data, including the issuer's Redemption
  462. // Records, intact.
  463. //
  464. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-clearTrustTokens
  465. //
  466. // parameters:
  467. //
  468. // issuerOrigin
  469. func ClearTrustTokens(issuerOrigin string) *ClearTrustTokensParams {
  470. return &ClearTrustTokensParams{
  471. IssuerOrigin: issuerOrigin,
  472. }
  473. }
  474. // ClearTrustTokensReturns return values.
  475. type ClearTrustTokensReturns struct {
  476. DidDeleteTokens bool `json:"didDeleteTokens"` // True if any tokens were deleted, false otherwise.
  477. }
  478. // Do executes Storage.clearTrustTokens against the provided context.
  479. //
  480. // returns:
  481. //
  482. // didDeleteTokens - True if any tokens were deleted, false otherwise.
  483. func (p *ClearTrustTokensParams) Do(ctx context.Context) (didDeleteTokens bool, err error) {
  484. // execute
  485. var res ClearTrustTokensReturns
  486. err = cdp.Execute(ctx, CommandClearTrustTokens, p, &res)
  487. if err != nil {
  488. return false, err
  489. }
  490. return res.DidDeleteTokens, nil
  491. }
  492. // GetInterestGroupDetailsParams gets details for a named interest group.
  493. type GetInterestGroupDetailsParams struct {
  494. OwnerOrigin string `json:"ownerOrigin"`
  495. Name string `json:"name"`
  496. }
  497. // GetInterestGroupDetails gets details for a named interest group.
  498. //
  499. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getInterestGroupDetails
  500. //
  501. // parameters:
  502. //
  503. // ownerOrigin
  504. // name
  505. func GetInterestGroupDetails(ownerOrigin string, name string) *GetInterestGroupDetailsParams {
  506. return &GetInterestGroupDetailsParams{
  507. OwnerOrigin: ownerOrigin,
  508. Name: name,
  509. }
  510. }
  511. // GetInterestGroupDetailsReturns return values.
  512. type GetInterestGroupDetailsReturns struct {
  513. Details jsontext.Value `json:"details,omitempty,omitzero"`
  514. }
  515. // Do executes Storage.getInterestGroupDetails against the provided context.
  516. //
  517. // returns:
  518. //
  519. // details - This largely corresponds to: https://wicg.github.io/turtledove/#dictdef-generatebidinterestgroup but has absolute expirationTime instead of relative lifetimeMs and also adds joiningOrigin.
  520. func (p *GetInterestGroupDetailsParams) Do(ctx context.Context) (details jsontext.Value, err error) {
  521. // execute
  522. var res GetInterestGroupDetailsReturns
  523. err = cdp.Execute(ctx, CommandGetInterestGroupDetails, p, &res)
  524. if err != nil {
  525. return nil, err
  526. }
  527. return res.Details, nil
  528. }
  529. // SetInterestGroupTrackingParams enables/Disables issuing of
  530. // interestGroupAccessed events.
  531. type SetInterestGroupTrackingParams struct {
  532. Enable bool `json:"enable"`
  533. }
  534. // SetInterestGroupTracking enables/Disables issuing of interestGroupAccessed
  535. // events.
  536. //
  537. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-setInterestGroupTracking
  538. //
  539. // parameters:
  540. //
  541. // enable
  542. func SetInterestGroupTracking(enable bool) *SetInterestGroupTrackingParams {
  543. return &SetInterestGroupTrackingParams{
  544. Enable: enable,
  545. }
  546. }
  547. // Do executes Storage.setInterestGroupTracking against the provided context.
  548. func (p *SetInterestGroupTrackingParams) Do(ctx context.Context) (err error) {
  549. return cdp.Execute(ctx, CommandSetInterestGroupTracking, p, nil)
  550. }
  551. // SetInterestGroupAuctionTrackingParams enables/Disables issuing of
  552. // interestGroupAuctionEventOccurred and
  553. // interestGroupAuctionNetworkRequestCreated.
  554. type SetInterestGroupAuctionTrackingParams struct {
  555. Enable bool `json:"enable"`
  556. }
  557. // SetInterestGroupAuctionTracking enables/Disables issuing of
  558. // interestGroupAuctionEventOccurred and
  559. // interestGroupAuctionNetworkRequestCreated.
  560. //
  561. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-setInterestGroupAuctionTracking
  562. //
  563. // parameters:
  564. //
  565. // enable
  566. func SetInterestGroupAuctionTracking(enable bool) *SetInterestGroupAuctionTrackingParams {
  567. return &SetInterestGroupAuctionTrackingParams{
  568. Enable: enable,
  569. }
  570. }
  571. // Do executes Storage.setInterestGroupAuctionTracking against the provided context.
  572. func (p *SetInterestGroupAuctionTrackingParams) Do(ctx context.Context) (err error) {
  573. return cdp.Execute(ctx, CommandSetInterestGroupAuctionTracking, p, nil)
  574. }
  575. // GetSharedStorageMetadataParams gets metadata for an origin's shared
  576. // storage.
  577. type GetSharedStorageMetadataParams struct {
  578. OwnerOrigin string `json:"ownerOrigin"`
  579. }
  580. // GetSharedStorageMetadata gets metadata for an origin's shared storage.
  581. //
  582. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getSharedStorageMetadata
  583. //
  584. // parameters:
  585. //
  586. // ownerOrigin
  587. func GetSharedStorageMetadata(ownerOrigin string) *GetSharedStorageMetadataParams {
  588. return &GetSharedStorageMetadataParams{
  589. OwnerOrigin: ownerOrigin,
  590. }
  591. }
  592. // GetSharedStorageMetadataReturns return values.
  593. type GetSharedStorageMetadataReturns struct {
  594. Metadata *SharedStorageMetadata `json:"metadata,omitempty,omitzero"`
  595. }
  596. // Do executes Storage.getSharedStorageMetadata against the provided context.
  597. //
  598. // returns:
  599. //
  600. // metadata
  601. func (p *GetSharedStorageMetadataParams) Do(ctx context.Context) (metadata *SharedStorageMetadata, err error) {
  602. // execute
  603. var res GetSharedStorageMetadataReturns
  604. err = cdp.Execute(ctx, CommandGetSharedStorageMetadata, p, &res)
  605. if err != nil {
  606. return nil, err
  607. }
  608. return res.Metadata, nil
  609. }
  610. // GetSharedStorageEntriesParams gets the entries in an given origin's shared
  611. // storage.
  612. type GetSharedStorageEntriesParams struct {
  613. OwnerOrigin string `json:"ownerOrigin"`
  614. }
  615. // GetSharedStorageEntries gets the entries in an given origin's shared
  616. // storage.
  617. //
  618. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getSharedStorageEntries
  619. //
  620. // parameters:
  621. //
  622. // ownerOrigin
  623. func GetSharedStorageEntries(ownerOrigin string) *GetSharedStorageEntriesParams {
  624. return &GetSharedStorageEntriesParams{
  625. OwnerOrigin: ownerOrigin,
  626. }
  627. }
  628. // GetSharedStorageEntriesReturns return values.
  629. type GetSharedStorageEntriesReturns struct {
  630. Entries []*SharedStorageEntry `json:"entries,omitempty,omitzero"`
  631. }
  632. // Do executes Storage.getSharedStorageEntries against the provided context.
  633. //
  634. // returns:
  635. //
  636. // entries
  637. func (p *GetSharedStorageEntriesParams) Do(ctx context.Context) (entries []*SharedStorageEntry, err error) {
  638. // execute
  639. var res GetSharedStorageEntriesReturns
  640. err = cdp.Execute(ctx, CommandGetSharedStorageEntries, p, &res)
  641. if err != nil {
  642. return nil, err
  643. }
  644. return res.Entries, nil
  645. }
  646. // SetSharedStorageEntryParams sets entry with key and value for a given
  647. // origin's shared storage.
  648. type SetSharedStorageEntryParams struct {
  649. OwnerOrigin string `json:"ownerOrigin"`
  650. Key string `json:"key"`
  651. Value string `json:"value"`
  652. IgnoreIfPresent bool `json:"ignoreIfPresent"` // If ignoreIfPresent is included and true, then only sets the entry if key doesn't already exist.
  653. }
  654. // SetSharedStorageEntry sets entry with key and value for a given origin's
  655. // shared storage.
  656. //
  657. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-setSharedStorageEntry
  658. //
  659. // parameters:
  660. //
  661. // ownerOrigin
  662. // key
  663. // value
  664. func SetSharedStorageEntry(ownerOrigin string, key string, value string) *SetSharedStorageEntryParams {
  665. return &SetSharedStorageEntryParams{
  666. OwnerOrigin: ownerOrigin,
  667. Key: key,
  668. Value: value,
  669. IgnoreIfPresent: false,
  670. }
  671. }
  672. // WithIgnoreIfPresent if ignoreIfPresent is included and true, then only
  673. // sets the entry if key doesn't already exist.
  674. func (p SetSharedStorageEntryParams) WithIgnoreIfPresent(ignoreIfPresent bool) *SetSharedStorageEntryParams {
  675. p.IgnoreIfPresent = ignoreIfPresent
  676. return &p
  677. }
  678. // Do executes Storage.setSharedStorageEntry against the provided context.
  679. func (p *SetSharedStorageEntryParams) Do(ctx context.Context) (err error) {
  680. return cdp.Execute(ctx, CommandSetSharedStorageEntry, p, nil)
  681. }
  682. // DeleteSharedStorageEntryParams deletes entry for key (if it exists) for a
  683. // given origin's shared storage.
  684. type DeleteSharedStorageEntryParams struct {
  685. OwnerOrigin string `json:"ownerOrigin"`
  686. Key string `json:"key"`
  687. }
  688. // DeleteSharedStorageEntry deletes entry for key (if it exists) for a given
  689. // origin's shared storage.
  690. //
  691. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-deleteSharedStorageEntry
  692. //
  693. // parameters:
  694. //
  695. // ownerOrigin
  696. // key
  697. func DeleteSharedStorageEntry(ownerOrigin string, key string) *DeleteSharedStorageEntryParams {
  698. return &DeleteSharedStorageEntryParams{
  699. OwnerOrigin: ownerOrigin,
  700. Key: key,
  701. }
  702. }
  703. // Do executes Storage.deleteSharedStorageEntry against the provided context.
  704. func (p *DeleteSharedStorageEntryParams) Do(ctx context.Context) (err error) {
  705. return cdp.Execute(ctx, CommandDeleteSharedStorageEntry, p, nil)
  706. }
  707. // ClearSharedStorageEntriesParams clears all entries for a given origin's
  708. // shared storage.
  709. type ClearSharedStorageEntriesParams struct {
  710. OwnerOrigin string `json:"ownerOrigin"`
  711. }
  712. // ClearSharedStorageEntries clears all entries for a given origin's shared
  713. // storage.
  714. //
  715. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-clearSharedStorageEntries
  716. //
  717. // parameters:
  718. //
  719. // ownerOrigin
  720. func ClearSharedStorageEntries(ownerOrigin string) *ClearSharedStorageEntriesParams {
  721. return &ClearSharedStorageEntriesParams{
  722. OwnerOrigin: ownerOrigin,
  723. }
  724. }
  725. // Do executes Storage.clearSharedStorageEntries against the provided context.
  726. func (p *ClearSharedStorageEntriesParams) Do(ctx context.Context) (err error) {
  727. return cdp.Execute(ctx, CommandClearSharedStorageEntries, p, nil)
  728. }
  729. // ResetSharedStorageBudgetParams resets the budget for ownerOrigin by
  730. // clearing all budget withdrawals.
  731. type ResetSharedStorageBudgetParams struct {
  732. OwnerOrigin string `json:"ownerOrigin"`
  733. }
  734. // ResetSharedStorageBudget resets the budget for ownerOrigin by clearing all
  735. // budget withdrawals.
  736. //
  737. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-resetSharedStorageBudget
  738. //
  739. // parameters:
  740. //
  741. // ownerOrigin
  742. func ResetSharedStorageBudget(ownerOrigin string) *ResetSharedStorageBudgetParams {
  743. return &ResetSharedStorageBudgetParams{
  744. OwnerOrigin: ownerOrigin,
  745. }
  746. }
  747. // Do executes Storage.resetSharedStorageBudget against the provided context.
  748. func (p *ResetSharedStorageBudgetParams) Do(ctx context.Context) (err error) {
  749. return cdp.Execute(ctx, CommandResetSharedStorageBudget, p, nil)
  750. }
  751. // SetSharedStorageTrackingParams enables/disables issuing of
  752. // sharedStorageAccessed events.
  753. type SetSharedStorageTrackingParams struct {
  754. Enable bool `json:"enable"`
  755. }
  756. // SetSharedStorageTracking enables/disables issuing of sharedStorageAccessed
  757. // events.
  758. //
  759. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-setSharedStorageTracking
  760. //
  761. // parameters:
  762. //
  763. // enable
  764. func SetSharedStorageTracking(enable bool) *SetSharedStorageTrackingParams {
  765. return &SetSharedStorageTrackingParams{
  766. Enable: enable,
  767. }
  768. }
  769. // Do executes Storage.setSharedStorageTracking against the provided context.
  770. func (p *SetSharedStorageTrackingParams) Do(ctx context.Context) (err error) {
  771. return cdp.Execute(ctx, CommandSetSharedStorageTracking, p, nil)
  772. }
  773. // SetStorageBucketTrackingParams set tracking for a storage key's buckets.
  774. type SetStorageBucketTrackingParams struct {
  775. StorageKey string `json:"storageKey"`
  776. Enable bool `json:"enable"`
  777. }
  778. // SetStorageBucketTracking set tracking for a storage key's buckets.
  779. //
  780. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-setStorageBucketTracking
  781. //
  782. // parameters:
  783. //
  784. // storageKey
  785. // enable
  786. func SetStorageBucketTracking(storageKey string, enable bool) *SetStorageBucketTrackingParams {
  787. return &SetStorageBucketTrackingParams{
  788. StorageKey: storageKey,
  789. Enable: enable,
  790. }
  791. }
  792. // Do executes Storage.setStorageBucketTracking against the provided context.
  793. func (p *SetStorageBucketTrackingParams) Do(ctx context.Context) (err error) {
  794. return cdp.Execute(ctx, CommandSetStorageBucketTracking, p, nil)
  795. }
  796. // DeleteStorageBucketParams deletes the Storage Bucket with the given
  797. // storage key and bucket name.
  798. type DeleteStorageBucketParams struct {
  799. Bucket *Bucket `json:"bucket"`
  800. }
  801. // DeleteStorageBucket deletes the Storage Bucket with the given storage key
  802. // and bucket name.
  803. //
  804. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-deleteStorageBucket
  805. //
  806. // parameters:
  807. //
  808. // bucket
  809. func DeleteStorageBucket(bucket *Bucket) *DeleteStorageBucketParams {
  810. return &DeleteStorageBucketParams{
  811. Bucket: bucket,
  812. }
  813. }
  814. // Do executes Storage.deleteStorageBucket against the provided context.
  815. func (p *DeleteStorageBucketParams) Do(ctx context.Context) (err error) {
  816. return cdp.Execute(ctx, CommandDeleteStorageBucket, p, nil)
  817. }
  818. // RunBounceTrackingMitigationsParams deletes state for sites identified as
  819. // potential bounce trackers, immediately.
  820. type RunBounceTrackingMitigationsParams struct{}
  821. // RunBounceTrackingMitigations deletes state for sites identified as
  822. // potential bounce trackers, immediately.
  823. //
  824. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-runBounceTrackingMitigations
  825. func RunBounceTrackingMitigations() *RunBounceTrackingMitigationsParams {
  826. return &RunBounceTrackingMitigationsParams{}
  827. }
  828. // RunBounceTrackingMitigationsReturns return values.
  829. type RunBounceTrackingMitigationsReturns struct {
  830. DeletedSites []string `json:"deletedSites,omitempty,omitzero"`
  831. }
  832. // Do executes Storage.runBounceTrackingMitigations against the provided context.
  833. //
  834. // returns:
  835. //
  836. // deletedSites
  837. func (p *RunBounceTrackingMitigationsParams) Do(ctx context.Context) (deletedSites []string, err error) {
  838. // execute
  839. var res RunBounceTrackingMitigationsReturns
  840. err = cdp.Execute(ctx, CommandRunBounceTrackingMitigations, nil, &res)
  841. if err != nil {
  842. return nil, err
  843. }
  844. return res.DeletedSites, nil
  845. }
  846. // SetAttributionReportingLocalTestingModeParams
  847. // https://wicg.github.io/attribution-reporting-api/.
  848. type SetAttributionReportingLocalTestingModeParams struct {
  849. Enabled bool `json:"enabled"` // If enabled, noise is suppressed and reports are sent immediately.
  850. }
  851. // SetAttributionReportingLocalTestingMode
  852. // https://wicg.github.io/attribution-reporting-api/.
  853. //
  854. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-setAttributionReportingLocalTestingMode
  855. //
  856. // parameters:
  857. //
  858. // enabled - If enabled, noise is suppressed and reports are sent immediately.
  859. func SetAttributionReportingLocalTestingMode(enabled bool) *SetAttributionReportingLocalTestingModeParams {
  860. return &SetAttributionReportingLocalTestingModeParams{
  861. Enabled: enabled,
  862. }
  863. }
  864. // Do executes Storage.setAttributionReportingLocalTestingMode against the provided context.
  865. func (p *SetAttributionReportingLocalTestingModeParams) Do(ctx context.Context) (err error) {
  866. return cdp.Execute(ctx, CommandSetAttributionReportingLocalTestingMode, p, nil)
  867. }
  868. // SetAttributionReportingTrackingParams enables/disables issuing of
  869. // Attribution Reporting events.
  870. type SetAttributionReportingTrackingParams struct {
  871. Enable bool `json:"enable"`
  872. }
  873. // SetAttributionReportingTracking enables/disables issuing of Attribution
  874. // Reporting events.
  875. //
  876. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-setAttributionReportingTracking
  877. //
  878. // parameters:
  879. //
  880. // enable
  881. func SetAttributionReportingTracking(enable bool) *SetAttributionReportingTrackingParams {
  882. return &SetAttributionReportingTrackingParams{
  883. Enable: enable,
  884. }
  885. }
  886. // Do executes Storage.setAttributionReportingTracking against the provided context.
  887. func (p *SetAttributionReportingTrackingParams) Do(ctx context.Context) (err error) {
  888. return cdp.Execute(ctx, CommandSetAttributionReportingTracking, p, nil)
  889. }
  890. // SendPendingAttributionReportsParams sends all pending Attribution Reports
  891. // immediately, regardless of their scheduled report time.
  892. type SendPendingAttributionReportsParams struct{}
  893. // SendPendingAttributionReports sends all pending Attribution Reports
  894. // immediately, regardless of their scheduled report time.
  895. //
  896. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-sendPendingAttributionReports
  897. func SendPendingAttributionReports() *SendPendingAttributionReportsParams {
  898. return &SendPendingAttributionReportsParams{}
  899. }
  900. // SendPendingAttributionReportsReturns return values.
  901. type SendPendingAttributionReportsReturns struct {
  902. NumSent int64 `json:"numSent,omitempty,omitzero"` // The number of reports that were sent.
  903. }
  904. // Do executes Storage.sendPendingAttributionReports against the provided context.
  905. //
  906. // returns:
  907. //
  908. // numSent - The number of reports that were sent.
  909. func (p *SendPendingAttributionReportsParams) Do(ctx context.Context) (numSent int64, err error) {
  910. // execute
  911. var res SendPendingAttributionReportsReturns
  912. err = cdp.Execute(ctx, CommandSendPendingAttributionReports, nil, &res)
  913. if err != nil {
  914. return 0, err
  915. }
  916. return res.NumSent, nil
  917. }
  918. // GetRelatedWebsiteSetsParams returns the effective Related Website Sets in
  919. // use by this profile for the browser session. The effective Related Website
  920. // Sets will not change during a browser session.
  921. type GetRelatedWebsiteSetsParams struct{}
  922. // GetRelatedWebsiteSets returns the effective Related Website Sets in use by
  923. // this profile for the browser session. The effective Related Website Sets will
  924. // not change during a browser session.
  925. //
  926. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getRelatedWebsiteSets
  927. func GetRelatedWebsiteSets() *GetRelatedWebsiteSetsParams {
  928. return &GetRelatedWebsiteSetsParams{}
  929. }
  930. // GetRelatedWebsiteSetsReturns return values.
  931. type GetRelatedWebsiteSetsReturns struct {
  932. Sets []*RelatedWebsiteSet `json:"sets,omitempty,omitzero"`
  933. }
  934. // Do executes Storage.getRelatedWebsiteSets against the provided context.
  935. //
  936. // returns:
  937. //
  938. // sets
  939. func (p *GetRelatedWebsiteSetsParams) Do(ctx context.Context) (sets []*RelatedWebsiteSet, err error) {
  940. // execute
  941. var res GetRelatedWebsiteSetsReturns
  942. err = cdp.Execute(ctx, CommandGetRelatedWebsiteSets, nil, &res)
  943. if err != nil {
  944. return nil, err
  945. }
  946. return res.Sets, nil
  947. }
  948. // GetAffectedURLsForThirdPartyCookieMetadataParams returns the list of URLs
  949. // from a page and its embedded resources that match existing grace period URL
  950. // pattern rules.
  951. // https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period.
  952. type GetAffectedURLsForThirdPartyCookieMetadataParams struct {
  953. FirstPartyURL string `json:"firstPartyUrl"` // The URL of the page currently being visited.
  954. ThirdPartyURLs []string `json:"thirdPartyUrls"` // The list of embedded resource URLs from the page.
  955. }
  956. // GetAffectedURLsForThirdPartyCookieMetadata returns the list of URLs from a
  957. // page and its embedded resources that match existing grace period URL pattern
  958. // rules.
  959. // https://developers.google.com/privacy-sandbox/cookies/temporary-exceptions/grace-period.
  960. //
  961. // See: https://chromedevtools.github.io/devtools-protocol/tot/Storage#method-getAffectedUrlsForThirdPartyCookieMetadata
  962. //
  963. // parameters:
  964. //
  965. // firstPartyURL - The URL of the page currently being visited.
  966. // thirdPartyURLs - The list of embedded resource URLs from the page.
  967. func GetAffectedURLsForThirdPartyCookieMetadata(firstPartyURL string, thirdPartyURLs []string) *GetAffectedURLsForThirdPartyCookieMetadataParams {
  968. return &GetAffectedURLsForThirdPartyCookieMetadataParams{
  969. FirstPartyURL: firstPartyURL,
  970. ThirdPartyURLs: thirdPartyURLs,
  971. }
  972. }
  973. // GetAffectedURLsForThirdPartyCookieMetadataReturns return values.
  974. type GetAffectedURLsForThirdPartyCookieMetadataReturns struct {
  975. MatchedURLs []string `json:"matchedUrls,omitempty,omitzero"` // Array of matching URLs. If there is a primary pattern match for the first- party URL, only the first-party URL is returned in the array.
  976. }
  977. // Do executes Storage.getAffectedUrlsForThirdPartyCookieMetadata against the provided context.
  978. //
  979. // returns:
  980. //
  981. // matchedURLs - Array of matching URLs. If there is a primary pattern match for the first- party URL, only the first-party URL is returned in the array.
  982. func (p *GetAffectedURLsForThirdPartyCookieMetadataParams) Do(ctx context.Context) (matchedURLs []string, err error) {
  983. // execute
  984. var res GetAffectedURLsForThirdPartyCookieMetadataReturns
  985. err = cdp.Execute(ctx, CommandGetAffectedURLsForThirdPartyCookieMetadata, p, &res)
  986. if err != nil {
  987. return nil, err
  988. }
  989. return res.MatchedURLs, nil
  990. }
  991. // Command names.
  992. const (
  993. CommandGetStorageKeyForFrame = "Storage.getStorageKeyForFrame"
  994. CommandClearDataForOrigin = "Storage.clearDataForOrigin"
  995. CommandClearDataForStorageKey = "Storage.clearDataForStorageKey"
  996. CommandGetCookies = "Storage.getCookies"
  997. CommandSetCookies = "Storage.setCookies"
  998. CommandClearCookies = "Storage.clearCookies"
  999. CommandGetUsageAndQuota = "Storage.getUsageAndQuota"
  1000. CommandOverrideQuotaForOrigin = "Storage.overrideQuotaForOrigin"
  1001. CommandTrackCacheStorageForOrigin = "Storage.trackCacheStorageForOrigin"
  1002. CommandTrackCacheStorageForStorageKey = "Storage.trackCacheStorageForStorageKey"
  1003. CommandTrackIndexedDBForOrigin = "Storage.trackIndexedDBForOrigin"
  1004. CommandTrackIndexedDBForStorageKey = "Storage.trackIndexedDBForStorageKey"
  1005. CommandUntrackCacheStorageForOrigin = "Storage.untrackCacheStorageForOrigin"
  1006. CommandUntrackCacheStorageForStorageKey = "Storage.untrackCacheStorageForStorageKey"
  1007. CommandUntrackIndexedDBForOrigin = "Storage.untrackIndexedDBForOrigin"
  1008. CommandUntrackIndexedDBForStorageKey = "Storage.untrackIndexedDBForStorageKey"
  1009. CommandGetTrustTokens = "Storage.getTrustTokens"
  1010. CommandClearTrustTokens = "Storage.clearTrustTokens"
  1011. CommandGetInterestGroupDetails = "Storage.getInterestGroupDetails"
  1012. CommandSetInterestGroupTracking = "Storage.setInterestGroupTracking"
  1013. CommandSetInterestGroupAuctionTracking = "Storage.setInterestGroupAuctionTracking"
  1014. CommandGetSharedStorageMetadata = "Storage.getSharedStorageMetadata"
  1015. CommandGetSharedStorageEntries = "Storage.getSharedStorageEntries"
  1016. CommandSetSharedStorageEntry = "Storage.setSharedStorageEntry"
  1017. CommandDeleteSharedStorageEntry = "Storage.deleteSharedStorageEntry"
  1018. CommandClearSharedStorageEntries = "Storage.clearSharedStorageEntries"
  1019. CommandResetSharedStorageBudget = "Storage.resetSharedStorageBudget"
  1020. CommandSetSharedStorageTracking = "Storage.setSharedStorageTracking"
  1021. CommandSetStorageBucketTracking = "Storage.setStorageBucketTracking"
  1022. CommandDeleteStorageBucket = "Storage.deleteStorageBucket"
  1023. CommandRunBounceTrackingMitigations = "Storage.runBounceTrackingMitigations"
  1024. CommandSetAttributionReportingLocalTestingMode = "Storage.setAttributionReportingLocalTestingMode"
  1025. CommandSetAttributionReportingTracking = "Storage.setAttributionReportingTracking"
  1026. CommandSendPendingAttributionReports = "Storage.sendPendingAttributionReports"
  1027. CommandGetRelatedWebsiteSets = "Storage.getRelatedWebsiteSets"
  1028. CommandGetAffectedURLsForThirdPartyCookieMetadata = "Storage.getAffectedUrlsForThirdPartyCookieMetadata"
  1029. )