ai-dev-browser 0.5.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (155) hide show
  1. ai_dev_browser/__init__.py +110 -0
  2. ai_dev_browser/_cli.py +428 -0
  3. ai_dev_browser/_version.py +13 -0
  4. ai_dev_browser/cdp/__init__.py +6 -0
  5. ai_dev_browser/cdp/accessibility.py +668 -0
  6. ai_dev_browser/cdp/animation.py +494 -0
  7. ai_dev_browser/cdp/audits.py +1990 -0
  8. ai_dev_browser/cdp/autofill.py +292 -0
  9. ai_dev_browser/cdp/background_service.py +215 -0
  10. ai_dev_browser/cdp/bluetooth_emulation.py +626 -0
  11. ai_dev_browser/cdp/browser.py +821 -0
  12. ai_dev_browser/cdp/cache_storage.py +311 -0
  13. ai_dev_browser/cdp/cast.py +172 -0
  14. ai_dev_browser/cdp/console.py +107 -0
  15. ai_dev_browser/cdp/crash_report_context.py +55 -0
  16. ai_dev_browser/cdp/css.py +2710 -0
  17. ai_dev_browser/cdp/debugger.py +1405 -0
  18. ai_dev_browser/cdp/device_access.py +141 -0
  19. ai_dev_browser/cdp/device_orientation.py +45 -0
  20. ai_dev_browser/cdp/dom.py +2257 -0
  21. ai_dev_browser/cdp/dom_debugger.py +321 -0
  22. ai_dev_browser/cdp/dom_snapshot.py +876 -0
  23. ai_dev_browser/cdp/dom_storage.py +222 -0
  24. ai_dev_browser/cdp/emulation.py +1779 -0
  25. ai_dev_browser/cdp/event_breakpoints.py +56 -0
  26. ai_dev_browser/cdp/extensions.py +246 -0
  27. ai_dev_browser/cdp/fed_cm.py +283 -0
  28. ai_dev_browser/cdp/fetch.py +507 -0
  29. ai_dev_browser/cdp/file_system.py +115 -0
  30. ai_dev_browser/cdp/headless_experimental.py +115 -0
  31. ai_dev_browser/cdp/heap_profiler.py +401 -0
  32. ai_dev_browser/cdp/indexed_db.py +528 -0
  33. ai_dev_browser/cdp/input_.py +701 -0
  34. ai_dev_browser/cdp/inspector.py +95 -0
  35. ai_dev_browser/cdp/io.py +101 -0
  36. ai_dev_browser/cdp/layer_tree.py +464 -0
  37. ai_dev_browser/cdp/log.py +190 -0
  38. ai_dev_browser/cdp/media.py +313 -0
  39. ai_dev_browser/cdp/memory.py +305 -0
  40. ai_dev_browser/cdp/network.py +5317 -0
  41. ai_dev_browser/cdp/overlay.py +1468 -0
  42. ai_dev_browser/cdp/page.py +3970 -0
  43. ai_dev_browser/cdp/performance.py +124 -0
  44. ai_dev_browser/cdp/performance_timeline.py +200 -0
  45. ai_dev_browser/cdp/preload.py +575 -0
  46. ai_dev_browser/cdp/profiler.py +420 -0
  47. ai_dev_browser/cdp/pwa.py +278 -0
  48. ai_dev_browser/cdp/py.typed +0 -0
  49. ai_dev_browser/cdp/runtime.py +1589 -0
  50. ai_dev_browser/cdp/schema.py +50 -0
  51. ai_dev_browser/cdp/security.py +518 -0
  52. ai_dev_browser/cdp/service_worker.py +401 -0
  53. ai_dev_browser/cdp/smart_card_emulation.py +891 -0
  54. ai_dev_browser/cdp/storage.py +1573 -0
  55. ai_dev_browser/cdp/system_info.py +327 -0
  56. ai_dev_browser/cdp/target.py +822 -0
  57. ai_dev_browser/cdp/tethering.py +65 -0
  58. ai_dev_browser/cdp/tracing.py +377 -0
  59. ai_dev_browser/cdp/util.py +17 -0
  60. ai_dev_browser/cdp/web_audio.py +606 -0
  61. ai_dev_browser/cdp/web_authn.py +598 -0
  62. ai_dev_browser/cdp/web_mcp.py +219 -0
  63. ai_dev_browser/core/__init__.py +218 -0
  64. ai_dev_browser/core/_case.py +38 -0
  65. ai_dev_browser/core/_cf_template.py +84 -0
  66. ai_dev_browser/core/_element.py +431 -0
  67. ai_dev_browser/core/_tab.py +817 -0
  68. ai_dev_browser/core/_transport.py +362 -0
  69. ai_dev_browser/core/ax.py +605 -0
  70. ai_dev_browser/core/browser.py +323 -0
  71. ai_dev_browser/core/cdp.py +66 -0
  72. ai_dev_browser/core/chrome.py +253 -0
  73. ai_dev_browser/core/cloudflare.py +77 -0
  74. ai_dev_browser/core/config.py +95 -0
  75. ai_dev_browser/core/connection.py +403 -0
  76. ai_dev_browser/core/cookies.py +103 -0
  77. ai_dev_browser/core/dialog.py +165 -0
  78. ai_dev_browser/core/download.py +38 -0
  79. ai_dev_browser/core/elements.py +913 -0
  80. ai_dev_browser/core/human.py +612 -0
  81. ai_dev_browser/core/login.py +122 -0
  82. ai_dev_browser/core/mouse.py +140 -0
  83. ai_dev_browser/core/navigation.py +225 -0
  84. ai_dev_browser/core/overlays.py +148 -0
  85. ai_dev_browser/core/page.py +302 -0
  86. ai_dev_browser/core/port.py +465 -0
  87. ai_dev_browser/core/process.py +114 -0
  88. ai_dev_browser/core/snapshot.py +425 -0
  89. ai_dev_browser/core/storage.py +50 -0
  90. ai_dev_browser/core/tabs.py +125 -0
  91. ai_dev_browser/core/text_match.py +217 -0
  92. ai_dev_browser/core/window.py +84 -0
  93. ai_dev_browser/pool/__init__.py +34 -0
  94. ai_dev_browser/pool/job.py +140 -0
  95. ai_dev_browser/pool/persistence.py +154 -0
  96. ai_dev_browser/pool/pool.py +873 -0
  97. ai_dev_browser/pool/worker.py +171 -0
  98. ai_dev_browser/profile.py +107 -0
  99. ai_dev_browser/py.typed +0 -0
  100. ai_dev_browser/tools/__init__.py +9 -0
  101. ai_dev_browser/tools/_generate.py +209 -0
  102. ai_dev_browser/tools/browser_list.py +14 -0
  103. ai_dev_browser/tools/browser_start.py +14 -0
  104. ai_dev_browser/tools/browser_stop.py +14 -0
  105. ai_dev_browser/tools/cdp_send.py +14 -0
  106. ai_dev_browser/tools/click_by_html_id.py +14 -0
  107. ai_dev_browser/tools/click_by_ref.py +14 -0
  108. ai_dev_browser/tools/click_by_text.py +14 -0
  109. ai_dev_browser/tools/click_by_xpath.py +14 -0
  110. ai_dev_browser/tools/cloudflare_verify.py +14 -0
  111. ai_dev_browser/tools/cookies_list.py +14 -0
  112. ai_dev_browser/tools/cookies_load.py +14 -0
  113. ai_dev_browser/tools/cookies_save.py +14 -0
  114. ai_dev_browser/tools/dialog_respond.py +14 -0
  115. ai_dev_browser/tools/download.py +14 -0
  116. ai_dev_browser/tools/drag_by_ref.py +14 -0
  117. ai_dev_browser/tools/find_by_html_id.py +14 -0
  118. ai_dev_browser/tools/find_by_xpath.py +14 -0
  119. ai_dev_browser/tools/focus_by_ref.py +14 -0
  120. ai_dev_browser/tools/highlight_by_ref.py +14 -0
  121. ai_dev_browser/tools/hover_by_ref.py +14 -0
  122. ai_dev_browser/tools/html_by_ref.py +14 -0
  123. ai_dev_browser/tools/js_evaluate.py +14 -0
  124. ai_dev_browser/tools/login_interactive.py +14 -0
  125. ai_dev_browser/tools/mouse_click.py +14 -0
  126. ai_dev_browser/tools/mouse_drag.py +14 -0
  127. ai_dev_browser/tools/mouse_move.py +14 -0
  128. ai_dev_browser/tools/page_discover.py +14 -0
  129. ai_dev_browser/tools/page_emulate_focus.py +14 -0
  130. ai_dev_browser/tools/page_goto.py +14 -0
  131. ai_dev_browser/tools/page_html.py +14 -0
  132. ai_dev_browser/tools/page_info.py +14 -0
  133. ai_dev_browser/tools/page_reload.py +14 -0
  134. ai_dev_browser/tools/page_screenshot.py +14 -0
  135. ai_dev_browser/tools/page_scroll.py +14 -0
  136. ai_dev_browser/tools/page_wait_element.py +14 -0
  137. ai_dev_browser/tools/page_wait_ready.py +14 -0
  138. ai_dev_browser/tools/page_wait_url.py +14 -0
  139. ai_dev_browser/tools/screenshot_by_ref.py +14 -0
  140. ai_dev_browser/tools/select_by_ref.py +14 -0
  141. ai_dev_browser/tools/storage_get.py +14 -0
  142. ai_dev_browser/tools/storage_set.py +14 -0
  143. ai_dev_browser/tools/tab_close.py +14 -0
  144. ai_dev_browser/tools/tab_list.py +14 -0
  145. ai_dev_browser/tools/tab_new.py +14 -0
  146. ai_dev_browser/tools/tab_switch.py +14 -0
  147. ai_dev_browser/tools/type_by_ref.py +14 -0
  148. ai_dev_browser/tools/type_by_text.py +14 -0
  149. ai_dev_browser/tools/upload_by_ref.py +14 -0
  150. ai_dev_browser/tools/window_set.py +14 -0
  151. ai_dev_browser-0.5.3.dist-info/METADATA +177 -0
  152. ai_dev_browser-0.5.3.dist-info/RECORD +155 -0
  153. ai_dev_browser-0.5.3.dist-info/WHEEL +5 -0
  154. ai_dev_browser-0.5.3.dist-info/licenses/LICENSE +25 -0
  155. ai_dev_browser-0.5.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1990 @@
1
+ # DO NOT EDIT THIS FILE!
2
+ #
3
+ # This file is generated from the CDP specification. If you need to make
4
+ # changes, edit the generator and regenerate all of the modules.
5
+ #
6
+ # CDP domain: Audits (experimental)
7
+
8
+ from __future__ import annotations
9
+ import enum
10
+ import typing
11
+ from dataclasses import dataclass
12
+ from .util import event_class, T_JSON_DICT
13
+
14
+ from . import dom
15
+ from . import network
16
+ from . import page
17
+ from . import runtime
18
+
19
+
20
+ @dataclass
21
+ class AffectedCookie:
22
+ '''
23
+ Information about a cookie that is affected by an inspector issue.
24
+ '''
25
+ #: The following three properties uniquely identify a cookie
26
+ name: str
27
+
28
+ path: str
29
+
30
+ domain: str
31
+
32
+ def to_json(self) -> T_JSON_DICT:
33
+ json: T_JSON_DICT = dict()
34
+ json['name'] = self.name
35
+ json['path'] = self.path
36
+ json['domain'] = self.domain
37
+ return json
38
+
39
+ @classmethod
40
+ def from_json(cls, json: T_JSON_DICT) -> AffectedCookie:
41
+ return cls(
42
+ name=str(json['name']),
43
+ path=str(json['path']),
44
+ domain=str(json['domain']),
45
+ )
46
+
47
+
48
+ @dataclass
49
+ class AffectedRequest:
50
+ '''
51
+ Information about a request that is affected by an inspector issue.
52
+ '''
53
+ url: str
54
+
55
+ #: The unique request id.
56
+ request_id: typing.Optional[network.RequestId] = None
57
+
58
+ def to_json(self) -> T_JSON_DICT:
59
+ json: T_JSON_DICT = dict()
60
+ json['url'] = self.url
61
+ if self.request_id is not None:
62
+ json['requestId'] = self.request_id.to_json()
63
+ return json
64
+
65
+ @classmethod
66
+ def from_json(cls, json: T_JSON_DICT) -> AffectedRequest:
67
+ return cls(
68
+ url=str(json['url']),
69
+ request_id=network.RequestId.from_json(json['requestId']) if json.get('requestId', None) is not None else None,
70
+ )
71
+
72
+
73
+ @dataclass
74
+ class AffectedFrame:
75
+ '''
76
+ Information about the frame affected by an inspector issue.
77
+ '''
78
+ frame_id: page.FrameId
79
+
80
+ def to_json(self) -> T_JSON_DICT:
81
+ json: T_JSON_DICT = dict()
82
+ json['frameId'] = self.frame_id.to_json()
83
+ return json
84
+
85
+ @classmethod
86
+ def from_json(cls, json: T_JSON_DICT) -> AffectedFrame:
87
+ return cls(
88
+ frame_id=page.FrameId.from_json(json['frameId']),
89
+ )
90
+
91
+
92
+ class CookieExclusionReason(enum.Enum):
93
+ EXCLUDE_SAME_SITE_UNSPECIFIED_TREATED_AS_LAX = "ExcludeSameSiteUnspecifiedTreatedAsLax"
94
+ EXCLUDE_SAME_SITE_NONE_INSECURE = "ExcludeSameSiteNoneInsecure"
95
+ EXCLUDE_SAME_SITE_LAX = "ExcludeSameSiteLax"
96
+ EXCLUDE_SAME_SITE_STRICT = "ExcludeSameSiteStrict"
97
+ EXCLUDE_DOMAIN_NON_ASCII = "ExcludeDomainNonASCII"
98
+ EXCLUDE_THIRD_PARTY_COOKIE_BLOCKED_IN_FIRST_PARTY_SET = "ExcludeThirdPartyCookieBlockedInFirstPartySet"
99
+ EXCLUDE_THIRD_PARTY_PHASEOUT = "ExcludeThirdPartyPhaseout"
100
+ EXCLUDE_PORT_MISMATCH = "ExcludePortMismatch"
101
+ EXCLUDE_SCHEME_MISMATCH = "ExcludeSchemeMismatch"
102
+
103
+ def to_json(self) -> str:
104
+ return self.value
105
+
106
+ @classmethod
107
+ def from_json(cls, json: str) -> CookieExclusionReason:
108
+ return cls(json)
109
+
110
+
111
+ class CookieWarningReason(enum.Enum):
112
+ WARN_SAME_SITE_UNSPECIFIED_CROSS_SITE_CONTEXT = "WarnSameSiteUnspecifiedCrossSiteContext"
113
+ WARN_SAME_SITE_NONE_INSECURE = "WarnSameSiteNoneInsecure"
114
+ WARN_SAME_SITE_UNSPECIFIED_LAX_ALLOW_UNSAFE = "WarnSameSiteUnspecifiedLaxAllowUnsafe"
115
+ WARN_SAME_SITE_STRICT_LAX_DOWNGRADE_STRICT = "WarnSameSiteStrictLaxDowngradeStrict"
116
+ WARN_SAME_SITE_STRICT_CROSS_DOWNGRADE_STRICT = "WarnSameSiteStrictCrossDowngradeStrict"
117
+ WARN_SAME_SITE_STRICT_CROSS_DOWNGRADE_LAX = "WarnSameSiteStrictCrossDowngradeLax"
118
+ WARN_SAME_SITE_LAX_CROSS_DOWNGRADE_STRICT = "WarnSameSiteLaxCrossDowngradeStrict"
119
+ WARN_SAME_SITE_LAX_CROSS_DOWNGRADE_LAX = "WarnSameSiteLaxCrossDowngradeLax"
120
+ WARN_ATTRIBUTE_VALUE_EXCEEDS_MAX_SIZE = "WarnAttributeValueExceedsMaxSize"
121
+ WARN_DOMAIN_NON_ASCII = "WarnDomainNonASCII"
122
+ WARN_THIRD_PARTY_PHASEOUT = "WarnThirdPartyPhaseout"
123
+ WARN_CROSS_SITE_REDIRECT_DOWNGRADE_CHANGES_INCLUSION = "WarnCrossSiteRedirectDowngradeChangesInclusion"
124
+ WARN_DEPRECATION_TRIAL_METADATA = "WarnDeprecationTrialMetadata"
125
+ WARN_THIRD_PARTY_COOKIE_HEURISTIC = "WarnThirdPartyCookieHeuristic"
126
+
127
+ def to_json(self) -> str:
128
+ return self.value
129
+
130
+ @classmethod
131
+ def from_json(cls, json: str) -> CookieWarningReason:
132
+ return cls(json)
133
+
134
+
135
+ class CookieOperation(enum.Enum):
136
+ SET_COOKIE = "SetCookie"
137
+ READ_COOKIE = "ReadCookie"
138
+
139
+ def to_json(self) -> str:
140
+ return self.value
141
+
142
+ @classmethod
143
+ def from_json(cls, json: str) -> CookieOperation:
144
+ return cls(json)
145
+
146
+
147
+ class InsightType(enum.Enum):
148
+ '''
149
+ Represents the category of insight that a cookie issue falls under.
150
+ '''
151
+ GIT_HUB_RESOURCE = "GitHubResource"
152
+ GRACE_PERIOD = "GracePeriod"
153
+ HEURISTICS = "Heuristics"
154
+
155
+ def to_json(self) -> str:
156
+ return self.value
157
+
158
+ @classmethod
159
+ def from_json(cls, json: str) -> InsightType:
160
+ return cls(json)
161
+
162
+
163
+ @dataclass
164
+ class CookieIssueInsight:
165
+ '''
166
+ Information about the suggested solution to a cookie issue.
167
+ '''
168
+ type_: InsightType
169
+
170
+ #: Link to table entry in third-party cookie migration readiness list.
171
+ table_entry_url: typing.Optional[str] = None
172
+
173
+ def to_json(self) -> T_JSON_DICT:
174
+ json: T_JSON_DICT = dict()
175
+ json['type'] = self.type_.to_json()
176
+ if self.table_entry_url is not None:
177
+ json['tableEntryUrl'] = self.table_entry_url
178
+ return json
179
+
180
+ @classmethod
181
+ def from_json(cls, json: T_JSON_DICT) -> CookieIssueInsight:
182
+ return cls(
183
+ type_=InsightType.from_json(json['type']),
184
+ table_entry_url=str(json['tableEntryUrl']) if json.get('tableEntryUrl', None) is not None else None,
185
+ )
186
+
187
+
188
+ @dataclass
189
+ class CookieIssueDetails:
190
+ '''
191
+ This information is currently necessary, as the front-end has a difficult
192
+ time finding a specific cookie. With this, we can convey specific error
193
+ information without the cookie.
194
+ '''
195
+ cookie_warning_reasons: typing.List[CookieWarningReason]
196
+
197
+ cookie_exclusion_reasons: typing.List[CookieExclusionReason]
198
+
199
+ #: Optionally identifies the site-for-cookies and the cookie url, which
200
+ #: may be used by the front-end as additional context.
201
+ operation: CookieOperation
202
+
203
+ #: If AffectedCookie is not set then rawCookieLine contains the raw
204
+ #: Set-Cookie header string. This hints at a problem where the
205
+ #: cookie line is syntactically or semantically malformed in a way
206
+ #: that no valid cookie could be created.
207
+ cookie: typing.Optional[AffectedCookie] = None
208
+
209
+ raw_cookie_line: typing.Optional[str] = None
210
+
211
+ site_for_cookies: typing.Optional[str] = None
212
+
213
+ cookie_url: typing.Optional[str] = None
214
+
215
+ request: typing.Optional[AffectedRequest] = None
216
+
217
+ #: The recommended solution to the issue.
218
+ insight: typing.Optional[CookieIssueInsight] = None
219
+
220
+ def to_json(self) -> T_JSON_DICT:
221
+ json: T_JSON_DICT = dict()
222
+ json['cookieWarningReasons'] = [i.to_json() for i in self.cookie_warning_reasons]
223
+ json['cookieExclusionReasons'] = [i.to_json() for i in self.cookie_exclusion_reasons]
224
+ json['operation'] = self.operation.to_json()
225
+ if self.cookie is not None:
226
+ json['cookie'] = self.cookie.to_json()
227
+ if self.raw_cookie_line is not None:
228
+ json['rawCookieLine'] = self.raw_cookie_line
229
+ if self.site_for_cookies is not None:
230
+ json['siteForCookies'] = self.site_for_cookies
231
+ if self.cookie_url is not None:
232
+ json['cookieUrl'] = self.cookie_url
233
+ if self.request is not None:
234
+ json['request'] = self.request.to_json()
235
+ if self.insight is not None:
236
+ json['insight'] = self.insight.to_json()
237
+ return json
238
+
239
+ @classmethod
240
+ def from_json(cls, json: T_JSON_DICT) -> CookieIssueDetails:
241
+ return cls(
242
+ cookie_warning_reasons=[CookieWarningReason.from_json(i) for i in json['cookieWarningReasons']],
243
+ cookie_exclusion_reasons=[CookieExclusionReason.from_json(i) for i in json['cookieExclusionReasons']],
244
+ operation=CookieOperation.from_json(json['operation']),
245
+ cookie=AffectedCookie.from_json(json['cookie']) if json.get('cookie', None) is not None else None,
246
+ raw_cookie_line=str(json['rawCookieLine']) if json.get('rawCookieLine', None) is not None else None,
247
+ site_for_cookies=str(json['siteForCookies']) if json.get('siteForCookies', None) is not None else None,
248
+ cookie_url=str(json['cookieUrl']) if json.get('cookieUrl', None) is not None else None,
249
+ request=AffectedRequest.from_json(json['request']) if json.get('request', None) is not None else None,
250
+ insight=CookieIssueInsight.from_json(json['insight']) if json.get('insight', None) is not None else None,
251
+ )
252
+
253
+
254
+ class PerformanceIssueType(enum.Enum):
255
+ DOCUMENT_COOKIE = "DocumentCookie"
256
+
257
+ def to_json(self) -> str:
258
+ return self.value
259
+
260
+ @classmethod
261
+ def from_json(cls, json: str) -> PerformanceIssueType:
262
+ return cls(json)
263
+
264
+
265
+ @dataclass
266
+ class PerformanceIssueDetails:
267
+ '''
268
+ Details for a performance issue.
269
+ '''
270
+ performance_issue_type: PerformanceIssueType
271
+
272
+ source_code_location: typing.Optional[SourceCodeLocation] = None
273
+
274
+ def to_json(self) -> T_JSON_DICT:
275
+ json: T_JSON_DICT = dict()
276
+ json['performanceIssueType'] = self.performance_issue_type.to_json()
277
+ if self.source_code_location is not None:
278
+ json['sourceCodeLocation'] = self.source_code_location.to_json()
279
+ return json
280
+
281
+ @classmethod
282
+ def from_json(cls, json: T_JSON_DICT) -> PerformanceIssueDetails:
283
+ return cls(
284
+ performance_issue_type=PerformanceIssueType.from_json(json['performanceIssueType']),
285
+ source_code_location=SourceCodeLocation.from_json(json['sourceCodeLocation']) if json.get('sourceCodeLocation', None) is not None else None,
286
+ )
287
+
288
+
289
+ class MixedContentResolutionStatus(enum.Enum):
290
+ MIXED_CONTENT_BLOCKED = "MixedContentBlocked"
291
+ MIXED_CONTENT_AUTOMATICALLY_UPGRADED = "MixedContentAutomaticallyUpgraded"
292
+ MIXED_CONTENT_WARNING = "MixedContentWarning"
293
+
294
+ def to_json(self) -> str:
295
+ return self.value
296
+
297
+ @classmethod
298
+ def from_json(cls, json: str) -> MixedContentResolutionStatus:
299
+ return cls(json)
300
+
301
+
302
+ class MixedContentResourceType(enum.Enum):
303
+ ATTRIBUTION_SRC = "AttributionSrc"
304
+ AUDIO = "Audio"
305
+ BEACON = "Beacon"
306
+ CSP_REPORT = "CSPReport"
307
+ DOWNLOAD = "Download"
308
+ EVENT_SOURCE = "EventSource"
309
+ FAVICON = "Favicon"
310
+ FONT = "Font"
311
+ FORM = "Form"
312
+ FRAME = "Frame"
313
+ IMAGE = "Image"
314
+ IMPORT = "Import"
315
+ JSON = "JSON"
316
+ MANIFEST = "Manifest"
317
+ PING = "Ping"
318
+ PLUGIN_DATA = "PluginData"
319
+ PLUGIN_RESOURCE = "PluginResource"
320
+ PREFETCH = "Prefetch"
321
+ RESOURCE = "Resource"
322
+ SCRIPT = "Script"
323
+ SERVICE_WORKER = "ServiceWorker"
324
+ SHARED_WORKER = "SharedWorker"
325
+ SPECULATION_RULES = "SpeculationRules"
326
+ STYLESHEET = "Stylesheet"
327
+ TRACK = "Track"
328
+ VIDEO = "Video"
329
+ WORKER = "Worker"
330
+ XML_HTTP_REQUEST = "XMLHttpRequest"
331
+ XSLT = "XSLT"
332
+
333
+ def to_json(self) -> str:
334
+ return self.value
335
+
336
+ @classmethod
337
+ def from_json(cls, json: str) -> MixedContentResourceType:
338
+ return cls(json)
339
+
340
+
341
+ @dataclass
342
+ class MixedContentIssueDetails:
343
+ #: The way the mixed content issue is being resolved.
344
+ resolution_status: MixedContentResolutionStatus
345
+
346
+ #: The unsafe http url causing the mixed content issue.
347
+ insecure_url: str
348
+
349
+ #: The url responsible for the call to an unsafe url.
350
+ main_resource_url: str
351
+
352
+ #: The type of resource causing the mixed content issue (css, js, iframe,
353
+ #: form,...). Marked as optional because it is mapped to from
354
+ #: blink::mojom::RequestContextType, which will be replaced
355
+ #: by network::mojom::RequestDestination
356
+ resource_type: typing.Optional[MixedContentResourceType] = None
357
+
358
+ #: The mixed content request.
359
+ #: Does not always exist (e.g. for unsafe form submission urls).
360
+ request: typing.Optional[AffectedRequest] = None
361
+
362
+ #: Optional because not every mixed content issue is necessarily linked to a frame.
363
+ frame: typing.Optional[AffectedFrame] = None
364
+
365
+ def to_json(self) -> T_JSON_DICT:
366
+ json: T_JSON_DICT = dict()
367
+ json['resolutionStatus'] = self.resolution_status.to_json()
368
+ json['insecureURL'] = self.insecure_url
369
+ json['mainResourceURL'] = self.main_resource_url
370
+ if self.resource_type is not None:
371
+ json['resourceType'] = self.resource_type.to_json()
372
+ if self.request is not None:
373
+ json['request'] = self.request.to_json()
374
+ if self.frame is not None:
375
+ json['frame'] = self.frame.to_json()
376
+ return json
377
+
378
+ @classmethod
379
+ def from_json(cls, json: T_JSON_DICT) -> MixedContentIssueDetails:
380
+ return cls(
381
+ resolution_status=MixedContentResolutionStatus.from_json(json['resolutionStatus']),
382
+ insecure_url=str(json['insecureURL']),
383
+ main_resource_url=str(json['mainResourceURL']),
384
+ resource_type=MixedContentResourceType.from_json(json['resourceType']) if json.get('resourceType', None) is not None else None,
385
+ request=AffectedRequest.from_json(json['request']) if json.get('request', None) is not None else None,
386
+ frame=AffectedFrame.from_json(json['frame']) if json.get('frame', None) is not None else None,
387
+ )
388
+
389
+
390
+ class BlockedByResponseReason(enum.Enum):
391
+ '''
392
+ Enum indicating the reason a response has been blocked. These reasons are
393
+ refinements of the net error BLOCKED_BY_RESPONSE.
394
+ '''
395
+ COEP_FRAME_RESOURCE_NEEDS_COEP_HEADER = "CoepFrameResourceNeedsCoepHeader"
396
+ COOP_SANDBOXED_I_FRAME_CANNOT_NAVIGATE_TO_COOP_PAGE = "CoopSandboxedIFrameCannotNavigateToCoopPage"
397
+ CORP_NOT_SAME_ORIGIN = "CorpNotSameOrigin"
398
+ CORP_NOT_SAME_ORIGIN_AFTER_DEFAULTED_TO_SAME_ORIGIN_BY_COEP = "CorpNotSameOriginAfterDefaultedToSameOriginByCoep"
399
+ CORP_NOT_SAME_ORIGIN_AFTER_DEFAULTED_TO_SAME_ORIGIN_BY_DIP = "CorpNotSameOriginAfterDefaultedToSameOriginByDip"
400
+ CORP_NOT_SAME_ORIGIN_AFTER_DEFAULTED_TO_SAME_ORIGIN_BY_COEP_AND_DIP = "CorpNotSameOriginAfterDefaultedToSameOriginByCoepAndDip"
401
+ CORP_NOT_SAME_SITE = "CorpNotSameSite"
402
+ SRI_MESSAGE_SIGNATURE_MISMATCH = "SRIMessageSignatureMismatch"
403
+
404
+ def to_json(self) -> str:
405
+ return self.value
406
+
407
+ @classmethod
408
+ def from_json(cls, json: str) -> BlockedByResponseReason:
409
+ return cls(json)
410
+
411
+
412
+ @dataclass
413
+ class BlockedByResponseIssueDetails:
414
+ '''
415
+ Details for a request that has been blocked with the BLOCKED_BY_RESPONSE
416
+ code. Currently only used for COEP/COOP, but may be extended to include
417
+ some CSP errors in the future.
418
+ '''
419
+ request: AffectedRequest
420
+
421
+ reason: BlockedByResponseReason
422
+
423
+ parent_frame: typing.Optional[AffectedFrame] = None
424
+
425
+ blocked_frame: typing.Optional[AffectedFrame] = None
426
+
427
+ def to_json(self) -> T_JSON_DICT:
428
+ json: T_JSON_DICT = dict()
429
+ json['request'] = self.request.to_json()
430
+ json['reason'] = self.reason.to_json()
431
+ if self.parent_frame is not None:
432
+ json['parentFrame'] = self.parent_frame.to_json()
433
+ if self.blocked_frame is not None:
434
+ json['blockedFrame'] = self.blocked_frame.to_json()
435
+ return json
436
+
437
+ @classmethod
438
+ def from_json(cls, json: T_JSON_DICT) -> BlockedByResponseIssueDetails:
439
+ return cls(
440
+ request=AffectedRequest.from_json(json['request']),
441
+ reason=BlockedByResponseReason.from_json(json['reason']),
442
+ parent_frame=AffectedFrame.from_json(json['parentFrame']) if json.get('parentFrame', None) is not None else None,
443
+ blocked_frame=AffectedFrame.from_json(json['blockedFrame']) if json.get('blockedFrame', None) is not None else None,
444
+ )
445
+
446
+
447
+ class HeavyAdResolutionStatus(enum.Enum):
448
+ HEAVY_AD_BLOCKED = "HeavyAdBlocked"
449
+ HEAVY_AD_WARNING = "HeavyAdWarning"
450
+
451
+ def to_json(self) -> str:
452
+ return self.value
453
+
454
+ @classmethod
455
+ def from_json(cls, json: str) -> HeavyAdResolutionStatus:
456
+ return cls(json)
457
+
458
+
459
+ class HeavyAdReason(enum.Enum):
460
+ NETWORK_TOTAL_LIMIT = "NetworkTotalLimit"
461
+ CPU_TOTAL_LIMIT = "CpuTotalLimit"
462
+ CPU_PEAK_LIMIT = "CpuPeakLimit"
463
+
464
+ def to_json(self) -> str:
465
+ return self.value
466
+
467
+ @classmethod
468
+ def from_json(cls, json: str) -> HeavyAdReason:
469
+ return cls(json)
470
+
471
+
472
+ @dataclass
473
+ class HeavyAdIssueDetails:
474
+ #: The resolution status, either blocking the content or warning.
475
+ resolution: HeavyAdResolutionStatus
476
+
477
+ #: The reason the ad was blocked, total network or cpu or peak cpu.
478
+ reason: HeavyAdReason
479
+
480
+ #: The frame that was blocked.
481
+ frame: AffectedFrame
482
+
483
+ def to_json(self) -> T_JSON_DICT:
484
+ json: T_JSON_DICT = dict()
485
+ json['resolution'] = self.resolution.to_json()
486
+ json['reason'] = self.reason.to_json()
487
+ json['frame'] = self.frame.to_json()
488
+ return json
489
+
490
+ @classmethod
491
+ def from_json(cls, json: T_JSON_DICT) -> HeavyAdIssueDetails:
492
+ return cls(
493
+ resolution=HeavyAdResolutionStatus.from_json(json['resolution']),
494
+ reason=HeavyAdReason.from_json(json['reason']),
495
+ frame=AffectedFrame.from_json(json['frame']),
496
+ )
497
+
498
+
499
+ class ContentSecurityPolicyViolationType(enum.Enum):
500
+ K_INLINE_VIOLATION = "kInlineViolation"
501
+ K_EVAL_VIOLATION = "kEvalViolation"
502
+ K_URL_VIOLATION = "kURLViolation"
503
+ K_SRI_VIOLATION = "kSRIViolation"
504
+ K_TRUSTED_TYPES_SINK_VIOLATION = "kTrustedTypesSinkViolation"
505
+ K_TRUSTED_TYPES_POLICY_VIOLATION = "kTrustedTypesPolicyViolation"
506
+ K_WASM_EVAL_VIOLATION = "kWasmEvalViolation"
507
+
508
+ def to_json(self) -> str:
509
+ return self.value
510
+
511
+ @classmethod
512
+ def from_json(cls, json: str) -> ContentSecurityPolicyViolationType:
513
+ return cls(json)
514
+
515
+
516
+ @dataclass
517
+ class SourceCodeLocation:
518
+ url: str
519
+
520
+ line_number: int
521
+
522
+ column_number: int
523
+
524
+ script_id: typing.Optional[runtime.ScriptId] = None
525
+
526
+ def to_json(self) -> T_JSON_DICT:
527
+ json: T_JSON_DICT = dict()
528
+ json['url'] = self.url
529
+ json['lineNumber'] = self.line_number
530
+ json['columnNumber'] = self.column_number
531
+ if self.script_id is not None:
532
+ json['scriptId'] = self.script_id.to_json()
533
+ return json
534
+
535
+ @classmethod
536
+ def from_json(cls, json: T_JSON_DICT) -> SourceCodeLocation:
537
+ return cls(
538
+ url=str(json['url']),
539
+ line_number=int(json['lineNumber']),
540
+ column_number=int(json['columnNumber']),
541
+ script_id=runtime.ScriptId.from_json(json['scriptId']) if json.get('scriptId', None) is not None else None,
542
+ )
543
+
544
+
545
+ @dataclass
546
+ class ContentSecurityPolicyIssueDetails:
547
+ #: Specific directive that is violated, causing the CSP issue.
548
+ violated_directive: str
549
+
550
+ is_report_only: bool
551
+
552
+ content_security_policy_violation_type: ContentSecurityPolicyViolationType
553
+
554
+ #: The url not included in allowed sources.
555
+ blocked_url: typing.Optional[str] = None
556
+
557
+ frame_ancestor: typing.Optional[AffectedFrame] = None
558
+
559
+ source_code_location: typing.Optional[SourceCodeLocation] = None
560
+
561
+ violating_node_id: typing.Optional[dom.BackendNodeId] = None
562
+
563
+ def to_json(self) -> T_JSON_DICT:
564
+ json: T_JSON_DICT = dict()
565
+ json['violatedDirective'] = self.violated_directive
566
+ json['isReportOnly'] = self.is_report_only
567
+ json['contentSecurityPolicyViolationType'] = self.content_security_policy_violation_type.to_json()
568
+ if self.blocked_url is not None:
569
+ json['blockedURL'] = self.blocked_url
570
+ if self.frame_ancestor is not None:
571
+ json['frameAncestor'] = self.frame_ancestor.to_json()
572
+ if self.source_code_location is not None:
573
+ json['sourceCodeLocation'] = self.source_code_location.to_json()
574
+ if self.violating_node_id is not None:
575
+ json['violatingNodeId'] = self.violating_node_id.to_json()
576
+ return json
577
+
578
+ @classmethod
579
+ def from_json(cls, json: T_JSON_DICT) -> ContentSecurityPolicyIssueDetails:
580
+ return cls(
581
+ violated_directive=str(json['violatedDirective']),
582
+ is_report_only=bool(json['isReportOnly']),
583
+ content_security_policy_violation_type=ContentSecurityPolicyViolationType.from_json(json['contentSecurityPolicyViolationType']),
584
+ blocked_url=str(json['blockedURL']) if json.get('blockedURL', None) is not None else None,
585
+ frame_ancestor=AffectedFrame.from_json(json['frameAncestor']) if json.get('frameAncestor', None) is not None else None,
586
+ source_code_location=SourceCodeLocation.from_json(json['sourceCodeLocation']) if json.get('sourceCodeLocation', None) is not None else None,
587
+ violating_node_id=dom.BackendNodeId.from_json(json['violatingNodeId']) if json.get('violatingNodeId', None) is not None else None,
588
+ )
589
+
590
+
591
+ class SharedArrayBufferIssueType(enum.Enum):
592
+ TRANSFER_ISSUE = "TransferIssue"
593
+ CREATION_ISSUE = "CreationIssue"
594
+
595
+ def to_json(self) -> str:
596
+ return self.value
597
+
598
+ @classmethod
599
+ def from_json(cls, json: str) -> SharedArrayBufferIssueType:
600
+ return cls(json)
601
+
602
+
603
+ @dataclass
604
+ class SharedArrayBufferIssueDetails:
605
+ '''
606
+ Details for a issue arising from an SAB being instantiated in, or
607
+ transferred to a context that is not cross-origin isolated.
608
+ '''
609
+ source_code_location: SourceCodeLocation
610
+
611
+ is_warning: bool
612
+
613
+ type_: SharedArrayBufferIssueType
614
+
615
+ def to_json(self) -> T_JSON_DICT:
616
+ json: T_JSON_DICT = dict()
617
+ json['sourceCodeLocation'] = self.source_code_location.to_json()
618
+ json['isWarning'] = self.is_warning
619
+ json['type'] = self.type_.to_json()
620
+ return json
621
+
622
+ @classmethod
623
+ def from_json(cls, json: T_JSON_DICT) -> SharedArrayBufferIssueDetails:
624
+ return cls(
625
+ source_code_location=SourceCodeLocation.from_json(json['sourceCodeLocation']),
626
+ is_warning=bool(json['isWarning']),
627
+ type_=SharedArrayBufferIssueType.from_json(json['type']),
628
+ )
629
+
630
+
631
+ @dataclass
632
+ class CorsIssueDetails:
633
+ '''
634
+ Details for a CORS related issue, e.g. a warning or error related to
635
+ CORS RFC1918 enforcement.
636
+ '''
637
+ cors_error_status: network.CorsErrorStatus
638
+
639
+ is_warning: bool
640
+
641
+ request: AffectedRequest
642
+
643
+ location: typing.Optional[SourceCodeLocation] = None
644
+
645
+ initiator_origin: typing.Optional[str] = None
646
+
647
+ resource_ip_address_space: typing.Optional[network.IPAddressSpace] = None
648
+
649
+ client_security_state: typing.Optional[network.ClientSecurityState] = None
650
+
651
+ def to_json(self) -> T_JSON_DICT:
652
+ json: T_JSON_DICT = dict()
653
+ json['corsErrorStatus'] = self.cors_error_status.to_json()
654
+ json['isWarning'] = self.is_warning
655
+ json['request'] = self.request.to_json()
656
+ if self.location is not None:
657
+ json['location'] = self.location.to_json()
658
+ if self.initiator_origin is not None:
659
+ json['initiatorOrigin'] = self.initiator_origin
660
+ if self.resource_ip_address_space is not None:
661
+ json['resourceIPAddressSpace'] = self.resource_ip_address_space.to_json()
662
+ if self.client_security_state is not None:
663
+ json['clientSecurityState'] = self.client_security_state.to_json()
664
+ return json
665
+
666
+ @classmethod
667
+ def from_json(cls, json: T_JSON_DICT) -> CorsIssueDetails:
668
+ return cls(
669
+ cors_error_status=network.CorsErrorStatus.from_json(json['corsErrorStatus']),
670
+ is_warning=bool(json['isWarning']),
671
+ request=AffectedRequest.from_json(json['request']),
672
+ location=SourceCodeLocation.from_json(json['location']) if json.get('location', None) is not None else None,
673
+ initiator_origin=str(json['initiatorOrigin']) if json.get('initiatorOrigin', None) is not None else None,
674
+ resource_ip_address_space=network.IPAddressSpace.from_json(json['resourceIPAddressSpace']) if json.get('resourceIPAddressSpace', None) is not None else None,
675
+ client_security_state=network.ClientSecurityState.from_json(json['clientSecurityState']) if json.get('clientSecurityState', None) is not None else None,
676
+ )
677
+
678
+
679
+ class AttributionReportingIssueType(enum.Enum):
680
+ PERMISSION_POLICY_DISABLED = "PermissionPolicyDisabled"
681
+ UNTRUSTWORTHY_REPORTING_ORIGIN = "UntrustworthyReportingOrigin"
682
+ INSECURE_CONTEXT = "InsecureContext"
683
+ INVALID_HEADER = "InvalidHeader"
684
+ INVALID_REGISTER_TRIGGER_HEADER = "InvalidRegisterTriggerHeader"
685
+ SOURCE_AND_TRIGGER_HEADERS = "SourceAndTriggerHeaders"
686
+ SOURCE_IGNORED = "SourceIgnored"
687
+ TRIGGER_IGNORED = "TriggerIgnored"
688
+ OS_SOURCE_IGNORED = "OsSourceIgnored"
689
+ OS_TRIGGER_IGNORED = "OsTriggerIgnored"
690
+ INVALID_REGISTER_OS_SOURCE_HEADER = "InvalidRegisterOsSourceHeader"
691
+ INVALID_REGISTER_OS_TRIGGER_HEADER = "InvalidRegisterOsTriggerHeader"
692
+ WEB_AND_OS_HEADERS = "WebAndOsHeaders"
693
+ NO_WEB_OR_OS_SUPPORT = "NoWebOrOsSupport"
694
+ NAVIGATION_REGISTRATION_WITHOUT_TRANSIENT_USER_ACTIVATION = "NavigationRegistrationWithoutTransientUserActivation"
695
+ INVALID_INFO_HEADER = "InvalidInfoHeader"
696
+ NO_REGISTER_SOURCE_HEADER = "NoRegisterSourceHeader"
697
+ NO_REGISTER_TRIGGER_HEADER = "NoRegisterTriggerHeader"
698
+ NO_REGISTER_OS_SOURCE_HEADER = "NoRegisterOsSourceHeader"
699
+ NO_REGISTER_OS_TRIGGER_HEADER = "NoRegisterOsTriggerHeader"
700
+ NAVIGATION_REGISTRATION_UNIQUE_SCOPE_ALREADY_SET = "NavigationRegistrationUniqueScopeAlreadySet"
701
+
702
+ def to_json(self) -> str:
703
+ return self.value
704
+
705
+ @classmethod
706
+ def from_json(cls, json: str) -> AttributionReportingIssueType:
707
+ return cls(json)
708
+
709
+
710
+ class SharedDictionaryError(enum.Enum):
711
+ USE_ERROR_CROSS_ORIGIN_NO_CORS_REQUEST = "UseErrorCrossOriginNoCorsRequest"
712
+ USE_ERROR_DICTIONARY_LOAD_FAILURE = "UseErrorDictionaryLoadFailure"
713
+ USE_ERROR_MATCHING_DICTIONARY_NOT_USED = "UseErrorMatchingDictionaryNotUsed"
714
+ USE_ERROR_UNEXPECTED_CONTENT_DICTIONARY_HEADER = "UseErrorUnexpectedContentDictionaryHeader"
715
+ WRITE_ERROR_COSS_ORIGIN_NO_CORS_REQUEST = "WriteErrorCossOriginNoCorsRequest"
716
+ WRITE_ERROR_DISALLOWED_BY_SETTINGS = "WriteErrorDisallowedBySettings"
717
+ WRITE_ERROR_EXPIRED_RESPONSE = "WriteErrorExpiredResponse"
718
+ WRITE_ERROR_FEATURE_DISABLED = "WriteErrorFeatureDisabled"
719
+ WRITE_ERROR_INSUFFICIENT_RESOURCES = "WriteErrorInsufficientResources"
720
+ WRITE_ERROR_INVALID_MATCH_FIELD = "WriteErrorInvalidMatchField"
721
+ WRITE_ERROR_INVALID_STRUCTURED_HEADER = "WriteErrorInvalidStructuredHeader"
722
+ WRITE_ERROR_INVALID_TTL_FIELD = "WriteErrorInvalidTTLField"
723
+ WRITE_ERROR_NAVIGATION_REQUEST = "WriteErrorNavigationRequest"
724
+ WRITE_ERROR_NO_MATCH_FIELD = "WriteErrorNoMatchField"
725
+ WRITE_ERROR_NON_INTEGER_TTL_FIELD = "WriteErrorNonIntegerTTLField"
726
+ WRITE_ERROR_NON_LIST_MATCH_DEST_FIELD = "WriteErrorNonListMatchDestField"
727
+ WRITE_ERROR_NON_SECURE_CONTEXT = "WriteErrorNonSecureContext"
728
+ WRITE_ERROR_NON_STRING_ID_FIELD = "WriteErrorNonStringIdField"
729
+ WRITE_ERROR_NON_STRING_IN_MATCH_DEST_LIST = "WriteErrorNonStringInMatchDestList"
730
+ WRITE_ERROR_NON_STRING_MATCH_FIELD = "WriteErrorNonStringMatchField"
731
+ WRITE_ERROR_NON_TOKEN_TYPE_FIELD = "WriteErrorNonTokenTypeField"
732
+ WRITE_ERROR_REQUEST_ABORTED = "WriteErrorRequestAborted"
733
+ WRITE_ERROR_SHUTTING_DOWN = "WriteErrorShuttingDown"
734
+ WRITE_ERROR_TOO_LONG_ID_FIELD = "WriteErrorTooLongIdField"
735
+ WRITE_ERROR_UNSUPPORTED_TYPE = "WriteErrorUnsupportedType"
736
+
737
+ def to_json(self) -> str:
738
+ return self.value
739
+
740
+ @classmethod
741
+ def from_json(cls, json: str) -> SharedDictionaryError:
742
+ return cls(json)
743
+
744
+
745
+ class SRIMessageSignatureError(enum.Enum):
746
+ MISSING_SIGNATURE_HEADER = "MissingSignatureHeader"
747
+ MISSING_SIGNATURE_INPUT_HEADER = "MissingSignatureInputHeader"
748
+ INVALID_SIGNATURE_HEADER = "InvalidSignatureHeader"
749
+ INVALID_SIGNATURE_INPUT_HEADER = "InvalidSignatureInputHeader"
750
+ SIGNATURE_HEADER_VALUE_IS_NOT_BYTE_SEQUENCE = "SignatureHeaderValueIsNotByteSequence"
751
+ SIGNATURE_HEADER_VALUE_IS_PARAMETERIZED = "SignatureHeaderValueIsParameterized"
752
+ SIGNATURE_HEADER_VALUE_IS_INCORRECT_LENGTH = "SignatureHeaderValueIsIncorrectLength"
753
+ SIGNATURE_INPUT_HEADER_MISSING_LABEL = "SignatureInputHeaderMissingLabel"
754
+ SIGNATURE_INPUT_HEADER_VALUE_NOT_INNER_LIST = "SignatureInputHeaderValueNotInnerList"
755
+ SIGNATURE_INPUT_HEADER_VALUE_MISSING_COMPONENTS = "SignatureInputHeaderValueMissingComponents"
756
+ SIGNATURE_INPUT_HEADER_INVALID_COMPONENT_TYPE = "SignatureInputHeaderInvalidComponentType"
757
+ SIGNATURE_INPUT_HEADER_INVALID_COMPONENT_NAME = "SignatureInputHeaderInvalidComponentName"
758
+ SIGNATURE_INPUT_HEADER_INVALID_HEADER_COMPONENT_PARAMETER = "SignatureInputHeaderInvalidHeaderComponentParameter"
759
+ SIGNATURE_INPUT_HEADER_INVALID_DERIVED_COMPONENT_PARAMETER = "SignatureInputHeaderInvalidDerivedComponentParameter"
760
+ SIGNATURE_INPUT_HEADER_KEY_ID_LENGTH = "SignatureInputHeaderKeyIdLength"
761
+ SIGNATURE_INPUT_HEADER_INVALID_PARAMETER = "SignatureInputHeaderInvalidParameter"
762
+ SIGNATURE_INPUT_HEADER_MISSING_REQUIRED_PARAMETERS = "SignatureInputHeaderMissingRequiredParameters"
763
+ VALIDATION_FAILED_SIGNATURE_EXPIRED = "ValidationFailedSignatureExpired"
764
+ VALIDATION_FAILED_INVALID_LENGTH = "ValidationFailedInvalidLength"
765
+ VALIDATION_FAILED_SIGNATURE_MISMATCH = "ValidationFailedSignatureMismatch"
766
+ VALIDATION_FAILED_INTEGRITY_MISMATCH = "ValidationFailedIntegrityMismatch"
767
+
768
+ def to_json(self) -> str:
769
+ return self.value
770
+
771
+ @classmethod
772
+ def from_json(cls, json: str) -> SRIMessageSignatureError:
773
+ return cls(json)
774
+
775
+
776
+ class UnencodedDigestError(enum.Enum):
777
+ MALFORMED_DICTIONARY = "MalformedDictionary"
778
+ UNKNOWN_ALGORITHM = "UnknownAlgorithm"
779
+ INCORRECT_DIGEST_TYPE = "IncorrectDigestType"
780
+ INCORRECT_DIGEST_LENGTH = "IncorrectDigestLength"
781
+
782
+ def to_json(self) -> str:
783
+ return self.value
784
+
785
+ @classmethod
786
+ def from_json(cls, json: str) -> UnencodedDigestError:
787
+ return cls(json)
788
+
789
+
790
+ class ConnectionAllowlistError(enum.Enum):
791
+ INVALID_HEADER = "InvalidHeader"
792
+ MORE_THAN_ONE_LIST = "MoreThanOneList"
793
+ ITEM_NOT_INNER_LIST = "ItemNotInnerList"
794
+ INVALID_ALLOWLIST_ITEM_TYPE = "InvalidAllowlistItemType"
795
+ REPORTING_ENDPOINT_NOT_TOKEN = "ReportingEndpointNotToken"
796
+ INVALID_URL_PATTERN = "InvalidUrlPattern"
797
+
798
+ def to_json(self) -> str:
799
+ return self.value
800
+
801
+ @classmethod
802
+ def from_json(cls, json: str) -> ConnectionAllowlistError:
803
+ return cls(json)
804
+
805
+
806
+ @dataclass
807
+ class AttributionReportingIssueDetails:
808
+ '''
809
+ Details for issues around "Attribution Reporting API" usage.
810
+ Explainer: https://github.com/WICG/attribution-reporting-api
811
+ '''
812
+ violation_type: AttributionReportingIssueType
813
+
814
+ request: typing.Optional[AffectedRequest] = None
815
+
816
+ violating_node_id: typing.Optional[dom.BackendNodeId] = None
817
+
818
+ invalid_parameter: typing.Optional[str] = None
819
+
820
+ def to_json(self) -> T_JSON_DICT:
821
+ json: T_JSON_DICT = dict()
822
+ json['violationType'] = self.violation_type.to_json()
823
+ if self.request is not None:
824
+ json['request'] = self.request.to_json()
825
+ if self.violating_node_id is not None:
826
+ json['violatingNodeId'] = self.violating_node_id.to_json()
827
+ if self.invalid_parameter is not None:
828
+ json['invalidParameter'] = self.invalid_parameter
829
+ return json
830
+
831
+ @classmethod
832
+ def from_json(cls, json: T_JSON_DICT) -> AttributionReportingIssueDetails:
833
+ return cls(
834
+ violation_type=AttributionReportingIssueType.from_json(json['violationType']),
835
+ request=AffectedRequest.from_json(json['request']) if json.get('request', None) is not None else None,
836
+ violating_node_id=dom.BackendNodeId.from_json(json['violatingNodeId']) if json.get('violatingNodeId', None) is not None else None,
837
+ invalid_parameter=str(json['invalidParameter']) if json.get('invalidParameter', None) is not None else None,
838
+ )
839
+
840
+
841
+ @dataclass
842
+ class QuirksModeIssueDetails:
843
+ '''
844
+ Details for issues about documents in Quirks Mode
845
+ or Limited Quirks Mode that affects page layouting.
846
+ '''
847
+ #: If false, it means the document's mode is "quirks"
848
+ #: instead of "limited-quirks".
849
+ is_limited_quirks_mode: bool
850
+
851
+ document_node_id: dom.BackendNodeId
852
+
853
+ url: str
854
+
855
+ frame_id: page.FrameId
856
+
857
+ loader_id: network.LoaderId
858
+
859
+ def to_json(self) -> T_JSON_DICT:
860
+ json: T_JSON_DICT = dict()
861
+ json['isLimitedQuirksMode'] = self.is_limited_quirks_mode
862
+ json['documentNodeId'] = self.document_node_id.to_json()
863
+ json['url'] = self.url
864
+ json['frameId'] = self.frame_id.to_json()
865
+ json['loaderId'] = self.loader_id.to_json()
866
+ return json
867
+
868
+ @classmethod
869
+ def from_json(cls, json: T_JSON_DICT) -> QuirksModeIssueDetails:
870
+ return cls(
871
+ is_limited_quirks_mode=bool(json['isLimitedQuirksMode']),
872
+ document_node_id=dom.BackendNodeId.from_json(json['documentNodeId']),
873
+ url=str(json['url']),
874
+ frame_id=page.FrameId.from_json(json['frameId']),
875
+ loader_id=network.LoaderId.from_json(json['loaderId']),
876
+ )
877
+
878
+
879
+ @dataclass
880
+ class NavigatorUserAgentIssueDetails:
881
+ url: str
882
+
883
+ location: typing.Optional[SourceCodeLocation] = None
884
+
885
+ def to_json(self) -> T_JSON_DICT:
886
+ json: T_JSON_DICT = dict()
887
+ json['url'] = self.url
888
+ if self.location is not None:
889
+ json['location'] = self.location.to_json()
890
+ return json
891
+
892
+ @classmethod
893
+ def from_json(cls, json: T_JSON_DICT) -> NavigatorUserAgentIssueDetails:
894
+ return cls(
895
+ url=str(json['url']),
896
+ location=SourceCodeLocation.from_json(json['location']) if json.get('location', None) is not None else None,
897
+ )
898
+
899
+
900
+ @dataclass
901
+ class SharedDictionaryIssueDetails:
902
+ shared_dictionary_error: SharedDictionaryError
903
+
904
+ request: AffectedRequest
905
+
906
+ def to_json(self) -> T_JSON_DICT:
907
+ json: T_JSON_DICT = dict()
908
+ json['sharedDictionaryError'] = self.shared_dictionary_error.to_json()
909
+ json['request'] = self.request.to_json()
910
+ return json
911
+
912
+ @classmethod
913
+ def from_json(cls, json: T_JSON_DICT) -> SharedDictionaryIssueDetails:
914
+ return cls(
915
+ shared_dictionary_error=SharedDictionaryError.from_json(json['sharedDictionaryError']),
916
+ request=AffectedRequest.from_json(json['request']),
917
+ )
918
+
919
+
920
+ @dataclass
921
+ class SRIMessageSignatureIssueDetails:
922
+ error: SRIMessageSignatureError
923
+
924
+ signature_base: str
925
+
926
+ integrity_assertions: typing.List[str]
927
+
928
+ request: AffectedRequest
929
+
930
+ def to_json(self) -> T_JSON_DICT:
931
+ json: T_JSON_DICT = dict()
932
+ json['error'] = self.error.to_json()
933
+ json['signatureBase'] = self.signature_base
934
+ json['integrityAssertions'] = [i for i in self.integrity_assertions]
935
+ json['request'] = self.request.to_json()
936
+ return json
937
+
938
+ @classmethod
939
+ def from_json(cls, json: T_JSON_DICT) -> SRIMessageSignatureIssueDetails:
940
+ return cls(
941
+ error=SRIMessageSignatureError.from_json(json['error']),
942
+ signature_base=str(json['signatureBase']),
943
+ integrity_assertions=[str(i) for i in json['integrityAssertions']],
944
+ request=AffectedRequest.from_json(json['request']),
945
+ )
946
+
947
+
948
+ @dataclass
949
+ class UnencodedDigestIssueDetails:
950
+ error: UnencodedDigestError
951
+
952
+ request: AffectedRequest
953
+
954
+ def to_json(self) -> T_JSON_DICT:
955
+ json: T_JSON_DICT = dict()
956
+ json['error'] = self.error.to_json()
957
+ json['request'] = self.request.to_json()
958
+ return json
959
+
960
+ @classmethod
961
+ def from_json(cls, json: T_JSON_DICT) -> UnencodedDigestIssueDetails:
962
+ return cls(
963
+ error=UnencodedDigestError.from_json(json['error']),
964
+ request=AffectedRequest.from_json(json['request']),
965
+ )
966
+
967
+
968
+ @dataclass
969
+ class ConnectionAllowlistIssueDetails:
970
+ error: ConnectionAllowlistError
971
+
972
+ request: AffectedRequest
973
+
974
+ def to_json(self) -> T_JSON_DICT:
975
+ json: T_JSON_DICT = dict()
976
+ json['error'] = self.error.to_json()
977
+ json['request'] = self.request.to_json()
978
+ return json
979
+
980
+ @classmethod
981
+ def from_json(cls, json: T_JSON_DICT) -> ConnectionAllowlistIssueDetails:
982
+ return cls(
983
+ error=ConnectionAllowlistError.from_json(json['error']),
984
+ request=AffectedRequest.from_json(json['request']),
985
+ )
986
+
987
+
988
+ class GenericIssueErrorType(enum.Enum):
989
+ FORM_LABEL_FOR_NAME_ERROR = "FormLabelForNameError"
990
+ FORM_DUPLICATE_ID_FOR_INPUT_ERROR = "FormDuplicateIdForInputError"
991
+ FORM_INPUT_WITH_NO_LABEL_ERROR = "FormInputWithNoLabelError"
992
+ FORM_AUTOCOMPLETE_ATTRIBUTE_EMPTY_ERROR = "FormAutocompleteAttributeEmptyError"
993
+ FORM_EMPTY_ID_AND_NAME_ATTRIBUTES_FOR_INPUT_ERROR = "FormEmptyIdAndNameAttributesForInputError"
994
+ FORM_ARIA_LABELLED_BY_TO_NON_EXISTING_ID_ERROR = "FormAriaLabelledByToNonExistingIdError"
995
+ FORM_INPUT_ASSIGNED_AUTOCOMPLETE_VALUE_TO_ID_OR_NAME_ATTRIBUTE_ERROR = "FormInputAssignedAutocompleteValueToIdOrNameAttributeError"
996
+ FORM_LABEL_HAS_NEITHER_FOR_NOR_NESTED_INPUT_ERROR = "FormLabelHasNeitherForNorNestedInputError"
997
+ FORM_LABEL_FOR_MATCHES_NON_EXISTING_ID_ERROR = "FormLabelForMatchesNonExistingIdError"
998
+ FORM_INPUT_HAS_WRONG_BUT_WELL_INTENDED_AUTOCOMPLETE_VALUE_ERROR = "FormInputHasWrongButWellIntendedAutocompleteValueError"
999
+ RESPONSE_WAS_BLOCKED_BY_ORB = "ResponseWasBlockedByORB"
1000
+ NAVIGATION_ENTRY_MARKED_SKIPPABLE = "NavigationEntryMarkedSkippable"
1001
+ AUTOFILL_AND_MANUAL_TEXT_POLICY_CONTROLLED_FEATURES_INFO = "AutofillAndManualTextPolicyControlledFeaturesInfo"
1002
+ AUTOFILL_POLICY_CONTROLLED_FEATURE_INFO = "AutofillPolicyControlledFeatureInfo"
1003
+ MANUAL_TEXT_POLICY_CONTROLLED_FEATURE_INFO = "ManualTextPolicyControlledFeatureInfo"
1004
+ FORM_MODEL_CONTEXT_PARAMETER_MISSING_TITLE_AND_DESCRIPTION = "FormModelContextParameterMissingTitleAndDescription"
1005
+
1006
+ def to_json(self) -> str:
1007
+ return self.value
1008
+
1009
+ @classmethod
1010
+ def from_json(cls, json: str) -> GenericIssueErrorType:
1011
+ return cls(json)
1012
+
1013
+
1014
+ @dataclass
1015
+ class GenericIssueDetails:
1016
+ '''
1017
+ Depending on the concrete errorType, different properties are set.
1018
+ '''
1019
+ #: Issues with the same errorType are aggregated in the frontend.
1020
+ error_type: GenericIssueErrorType
1021
+
1022
+ frame_id: typing.Optional[page.FrameId] = None
1023
+
1024
+ violating_node_id: typing.Optional[dom.BackendNodeId] = None
1025
+
1026
+ violating_node_attribute: typing.Optional[str] = None
1027
+
1028
+ request: typing.Optional[AffectedRequest] = None
1029
+
1030
+ def to_json(self) -> T_JSON_DICT:
1031
+ json: T_JSON_DICT = dict()
1032
+ json['errorType'] = self.error_type.to_json()
1033
+ if self.frame_id is not None:
1034
+ json['frameId'] = self.frame_id.to_json()
1035
+ if self.violating_node_id is not None:
1036
+ json['violatingNodeId'] = self.violating_node_id.to_json()
1037
+ if self.violating_node_attribute is not None:
1038
+ json['violatingNodeAttribute'] = self.violating_node_attribute
1039
+ if self.request is not None:
1040
+ json['request'] = self.request.to_json()
1041
+ return json
1042
+
1043
+ @classmethod
1044
+ def from_json(cls, json: T_JSON_DICT) -> GenericIssueDetails:
1045
+ return cls(
1046
+ error_type=GenericIssueErrorType.from_json(json['errorType']),
1047
+ frame_id=page.FrameId.from_json(json['frameId']) if json.get('frameId', None) is not None else None,
1048
+ violating_node_id=dom.BackendNodeId.from_json(json['violatingNodeId']) if json.get('violatingNodeId', None) is not None else None,
1049
+ violating_node_attribute=str(json['violatingNodeAttribute']) if json.get('violatingNodeAttribute', None) is not None else None,
1050
+ request=AffectedRequest.from_json(json['request']) if json.get('request', None) is not None else None,
1051
+ )
1052
+
1053
+
1054
+ @dataclass
1055
+ class DeprecationIssueDetails:
1056
+ '''
1057
+ This issue tracks information needed to print a deprecation message.
1058
+ https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/frame/third_party/blink/renderer/core/frame/deprecation/README.md
1059
+ '''
1060
+ source_code_location: SourceCodeLocation
1061
+
1062
+ #: One of the deprecation names from third_party/blink/renderer/core/frame/deprecation/deprecation.json5
1063
+ type_: str
1064
+
1065
+ affected_frame: typing.Optional[AffectedFrame] = None
1066
+
1067
+ def to_json(self) -> T_JSON_DICT:
1068
+ json: T_JSON_DICT = dict()
1069
+ json['sourceCodeLocation'] = self.source_code_location.to_json()
1070
+ json['type'] = self.type_
1071
+ if self.affected_frame is not None:
1072
+ json['affectedFrame'] = self.affected_frame.to_json()
1073
+ return json
1074
+
1075
+ @classmethod
1076
+ def from_json(cls, json: T_JSON_DICT) -> DeprecationIssueDetails:
1077
+ return cls(
1078
+ source_code_location=SourceCodeLocation.from_json(json['sourceCodeLocation']),
1079
+ type_=str(json['type']),
1080
+ affected_frame=AffectedFrame.from_json(json['affectedFrame']) if json.get('affectedFrame', None) is not None else None,
1081
+ )
1082
+
1083
+
1084
+ @dataclass
1085
+ class BounceTrackingIssueDetails:
1086
+ '''
1087
+ This issue warns about sites in the redirect chain of a finished navigation
1088
+ that may be flagged as trackers and have their state cleared if they don't
1089
+ receive a user interaction. Note that in this context 'site' means eTLD+1.
1090
+ For example, if the URL ``https://example.test:80/bounce`` was in the
1091
+ redirect chain, the site reported would be ``example.test``.
1092
+ '''
1093
+ tracking_sites: typing.List[str]
1094
+
1095
+ def to_json(self) -> T_JSON_DICT:
1096
+ json: T_JSON_DICT = dict()
1097
+ json['trackingSites'] = [i for i in self.tracking_sites]
1098
+ return json
1099
+
1100
+ @classmethod
1101
+ def from_json(cls, json: T_JSON_DICT) -> BounceTrackingIssueDetails:
1102
+ return cls(
1103
+ tracking_sites=[str(i) for i in json['trackingSites']],
1104
+ )
1105
+
1106
+
1107
+ @dataclass
1108
+ class CookieDeprecationMetadataIssueDetails:
1109
+ '''
1110
+ This issue warns about third-party sites that are accessing cookies on the
1111
+ current page, and have been permitted due to having a global metadata grant.
1112
+ Note that in this context 'site' means eTLD+1. For example, if the URL
1113
+ ``https://example.test:80/web_page`` was accessing cookies, the site reported
1114
+ would be ``example.test``.
1115
+ '''
1116
+ allowed_sites: typing.List[str]
1117
+
1118
+ opt_out_percentage: float
1119
+
1120
+ is_opt_out_top_level: bool
1121
+
1122
+ operation: CookieOperation
1123
+
1124
+ def to_json(self) -> T_JSON_DICT:
1125
+ json: T_JSON_DICT = dict()
1126
+ json['allowedSites'] = [i for i in self.allowed_sites]
1127
+ json['optOutPercentage'] = self.opt_out_percentage
1128
+ json['isOptOutTopLevel'] = self.is_opt_out_top_level
1129
+ json['operation'] = self.operation.to_json()
1130
+ return json
1131
+
1132
+ @classmethod
1133
+ def from_json(cls, json: T_JSON_DICT) -> CookieDeprecationMetadataIssueDetails:
1134
+ return cls(
1135
+ allowed_sites=[str(i) for i in json['allowedSites']],
1136
+ opt_out_percentage=float(json['optOutPercentage']),
1137
+ is_opt_out_top_level=bool(json['isOptOutTopLevel']),
1138
+ operation=CookieOperation.from_json(json['operation']),
1139
+ )
1140
+
1141
+
1142
+ class ClientHintIssueReason(enum.Enum):
1143
+ META_TAG_ALLOW_LIST_INVALID_ORIGIN = "MetaTagAllowListInvalidOrigin"
1144
+ META_TAG_MODIFIED_HTML = "MetaTagModifiedHTML"
1145
+
1146
+ def to_json(self) -> str:
1147
+ return self.value
1148
+
1149
+ @classmethod
1150
+ def from_json(cls, json: str) -> ClientHintIssueReason:
1151
+ return cls(json)
1152
+
1153
+
1154
+ @dataclass
1155
+ class FederatedAuthRequestIssueDetails:
1156
+ federated_auth_request_issue_reason: FederatedAuthRequestIssueReason
1157
+
1158
+ def to_json(self) -> T_JSON_DICT:
1159
+ json: T_JSON_DICT = dict()
1160
+ json['federatedAuthRequestIssueReason'] = self.federated_auth_request_issue_reason.to_json()
1161
+ return json
1162
+
1163
+ @classmethod
1164
+ def from_json(cls, json: T_JSON_DICT) -> FederatedAuthRequestIssueDetails:
1165
+ return cls(
1166
+ federated_auth_request_issue_reason=FederatedAuthRequestIssueReason.from_json(json['federatedAuthRequestIssueReason']),
1167
+ )
1168
+
1169
+
1170
+ class FederatedAuthRequestIssueReason(enum.Enum):
1171
+ '''
1172
+ Represents the failure reason when a federated authentication reason fails.
1173
+ Should be updated alongside RequestIdTokenStatus in
1174
+ third_party/blink/public/mojom/devtools/inspector_issue.mojom to include
1175
+ all cases except for success.
1176
+ '''
1177
+ SHOULD_EMBARGO = "ShouldEmbargo"
1178
+ TOO_MANY_REQUESTS = "TooManyRequests"
1179
+ WELL_KNOWN_HTTP_NOT_FOUND = "WellKnownHttpNotFound"
1180
+ WELL_KNOWN_NO_RESPONSE = "WellKnownNoResponse"
1181
+ WELL_KNOWN_INVALID_RESPONSE = "WellKnownInvalidResponse"
1182
+ WELL_KNOWN_LIST_EMPTY = "WellKnownListEmpty"
1183
+ WELL_KNOWN_INVALID_CONTENT_TYPE = "WellKnownInvalidContentType"
1184
+ CONFIG_NOT_IN_WELL_KNOWN = "ConfigNotInWellKnown"
1185
+ WELL_KNOWN_TOO_BIG = "WellKnownTooBig"
1186
+ CONFIG_HTTP_NOT_FOUND = "ConfigHttpNotFound"
1187
+ CONFIG_NO_RESPONSE = "ConfigNoResponse"
1188
+ CONFIG_INVALID_RESPONSE = "ConfigInvalidResponse"
1189
+ CONFIG_INVALID_CONTENT_TYPE = "ConfigInvalidContentType"
1190
+ IDP_NOT_POTENTIALLY_TRUSTWORTHY = "IdpNotPotentiallyTrustworthy"
1191
+ DISABLED_IN_SETTINGS = "DisabledInSettings"
1192
+ DISABLED_IN_FLAGS = "DisabledInFlags"
1193
+ ERROR_FETCHING_SIGNIN = "ErrorFetchingSignin"
1194
+ INVALID_SIGNIN_RESPONSE = "InvalidSigninResponse"
1195
+ ACCOUNTS_HTTP_NOT_FOUND = "AccountsHttpNotFound"
1196
+ ACCOUNTS_NO_RESPONSE = "AccountsNoResponse"
1197
+ ACCOUNTS_INVALID_RESPONSE = "AccountsInvalidResponse"
1198
+ ACCOUNTS_LIST_EMPTY = "AccountsListEmpty"
1199
+ ACCOUNTS_INVALID_CONTENT_TYPE = "AccountsInvalidContentType"
1200
+ ID_TOKEN_HTTP_NOT_FOUND = "IdTokenHttpNotFound"
1201
+ ID_TOKEN_NO_RESPONSE = "IdTokenNoResponse"
1202
+ ID_TOKEN_INVALID_RESPONSE = "IdTokenInvalidResponse"
1203
+ ID_TOKEN_IDP_ERROR_RESPONSE = "IdTokenIdpErrorResponse"
1204
+ ID_TOKEN_CROSS_SITE_IDP_ERROR_RESPONSE = "IdTokenCrossSiteIdpErrorResponse"
1205
+ ID_TOKEN_INVALID_REQUEST = "IdTokenInvalidRequest"
1206
+ ID_TOKEN_INVALID_CONTENT_TYPE = "IdTokenInvalidContentType"
1207
+ ERROR_ID_TOKEN = "ErrorIdToken"
1208
+ CANCELED = "Canceled"
1209
+ RP_PAGE_NOT_VISIBLE = "RpPageNotVisible"
1210
+ SILENT_MEDIATION_FAILURE = "SilentMediationFailure"
1211
+ NOT_SIGNED_IN_WITH_IDP = "NotSignedInWithIdp"
1212
+ MISSING_TRANSIENT_USER_ACTIVATION = "MissingTransientUserActivation"
1213
+ REPLACED_BY_ACTIVE_MODE = "ReplacedByActiveMode"
1214
+ RELYING_PARTY_ORIGIN_IS_OPAQUE = "RelyingPartyOriginIsOpaque"
1215
+ TYPE_NOT_MATCHING = "TypeNotMatching"
1216
+ UI_DISMISSED_NO_EMBARGO = "UiDismissedNoEmbargo"
1217
+ CORS_ERROR = "CorsError"
1218
+ SUPPRESSED_BY_SEGMENTATION_PLATFORM = "SuppressedBySegmentationPlatform"
1219
+
1220
+ def to_json(self) -> str:
1221
+ return self.value
1222
+
1223
+ @classmethod
1224
+ def from_json(cls, json: str) -> FederatedAuthRequestIssueReason:
1225
+ return cls(json)
1226
+
1227
+
1228
+ @dataclass
1229
+ class FederatedAuthUserInfoRequestIssueDetails:
1230
+ federated_auth_user_info_request_issue_reason: FederatedAuthUserInfoRequestIssueReason
1231
+
1232
+ def to_json(self) -> T_JSON_DICT:
1233
+ json: T_JSON_DICT = dict()
1234
+ json['federatedAuthUserInfoRequestIssueReason'] = self.federated_auth_user_info_request_issue_reason.to_json()
1235
+ return json
1236
+
1237
+ @classmethod
1238
+ def from_json(cls, json: T_JSON_DICT) -> FederatedAuthUserInfoRequestIssueDetails:
1239
+ return cls(
1240
+ federated_auth_user_info_request_issue_reason=FederatedAuthUserInfoRequestIssueReason.from_json(json['federatedAuthUserInfoRequestIssueReason']),
1241
+ )
1242
+
1243
+
1244
+ class FederatedAuthUserInfoRequestIssueReason(enum.Enum):
1245
+ '''
1246
+ Represents the failure reason when a getUserInfo() call fails.
1247
+ Should be updated alongside FederatedAuthUserInfoRequestResult in
1248
+ third_party/blink/public/mojom/devtools/inspector_issue.mojom.
1249
+ '''
1250
+ NOT_SAME_ORIGIN = "NotSameOrigin"
1251
+ NOT_IFRAME = "NotIframe"
1252
+ NOT_POTENTIALLY_TRUSTWORTHY = "NotPotentiallyTrustworthy"
1253
+ NO_API_PERMISSION = "NoApiPermission"
1254
+ NOT_SIGNED_IN_WITH_IDP = "NotSignedInWithIdp"
1255
+ NO_ACCOUNT_SHARING_PERMISSION = "NoAccountSharingPermission"
1256
+ INVALID_CONFIG_OR_WELL_KNOWN = "InvalidConfigOrWellKnown"
1257
+ INVALID_ACCOUNTS_RESPONSE = "InvalidAccountsResponse"
1258
+ NO_RETURNING_USER_FROM_FETCHED_ACCOUNTS = "NoReturningUserFromFetchedAccounts"
1259
+
1260
+ def to_json(self) -> str:
1261
+ return self.value
1262
+
1263
+ @classmethod
1264
+ def from_json(cls, json: str) -> FederatedAuthUserInfoRequestIssueReason:
1265
+ return cls(json)
1266
+
1267
+
1268
+ @dataclass
1269
+ class ClientHintIssueDetails:
1270
+ '''
1271
+ This issue tracks client hints related issues. It's used to deprecate old
1272
+ features, encourage the use of new ones, and provide general guidance.
1273
+ '''
1274
+ source_code_location: SourceCodeLocation
1275
+
1276
+ client_hint_issue_reason: ClientHintIssueReason
1277
+
1278
+ def to_json(self) -> T_JSON_DICT:
1279
+ json: T_JSON_DICT = dict()
1280
+ json['sourceCodeLocation'] = self.source_code_location.to_json()
1281
+ json['clientHintIssueReason'] = self.client_hint_issue_reason.to_json()
1282
+ return json
1283
+
1284
+ @classmethod
1285
+ def from_json(cls, json: T_JSON_DICT) -> ClientHintIssueDetails:
1286
+ return cls(
1287
+ source_code_location=SourceCodeLocation.from_json(json['sourceCodeLocation']),
1288
+ client_hint_issue_reason=ClientHintIssueReason.from_json(json['clientHintIssueReason']),
1289
+ )
1290
+
1291
+
1292
+ @dataclass
1293
+ class FailedRequestInfo:
1294
+ #: The URL that failed to load.
1295
+ url: str
1296
+
1297
+ #: The failure message for the failed request.
1298
+ failure_message: str
1299
+
1300
+ request_id: typing.Optional[network.RequestId] = None
1301
+
1302
+ def to_json(self) -> T_JSON_DICT:
1303
+ json: T_JSON_DICT = dict()
1304
+ json['url'] = self.url
1305
+ json['failureMessage'] = self.failure_message
1306
+ if self.request_id is not None:
1307
+ json['requestId'] = self.request_id.to_json()
1308
+ return json
1309
+
1310
+ @classmethod
1311
+ def from_json(cls, json: T_JSON_DICT) -> FailedRequestInfo:
1312
+ return cls(
1313
+ url=str(json['url']),
1314
+ failure_message=str(json['failureMessage']),
1315
+ request_id=network.RequestId.from_json(json['requestId']) if json.get('requestId', None) is not None else None,
1316
+ )
1317
+
1318
+
1319
+ class PartitioningBlobURLInfo(enum.Enum):
1320
+ BLOCKED_CROSS_PARTITION_FETCHING = "BlockedCrossPartitionFetching"
1321
+ ENFORCE_NOOPENER_FOR_NAVIGATION = "EnforceNoopenerForNavigation"
1322
+
1323
+ def to_json(self) -> str:
1324
+ return self.value
1325
+
1326
+ @classmethod
1327
+ def from_json(cls, json: str) -> PartitioningBlobURLInfo:
1328
+ return cls(json)
1329
+
1330
+
1331
+ @dataclass
1332
+ class PartitioningBlobURLIssueDetails:
1333
+ #: The BlobURL that failed to load.
1334
+ url: str
1335
+
1336
+ #: Additional information about the Partitioning Blob URL issue.
1337
+ partitioning_blob_url_info: PartitioningBlobURLInfo
1338
+
1339
+ def to_json(self) -> T_JSON_DICT:
1340
+ json: T_JSON_DICT = dict()
1341
+ json['url'] = self.url
1342
+ json['partitioningBlobURLInfo'] = self.partitioning_blob_url_info.to_json()
1343
+ return json
1344
+
1345
+ @classmethod
1346
+ def from_json(cls, json: T_JSON_DICT) -> PartitioningBlobURLIssueDetails:
1347
+ return cls(
1348
+ url=str(json['url']),
1349
+ partitioning_blob_url_info=PartitioningBlobURLInfo.from_json(json['partitioningBlobURLInfo']),
1350
+ )
1351
+
1352
+
1353
+ class ElementAccessibilityIssueReason(enum.Enum):
1354
+ DISALLOWED_SELECT_CHILD = "DisallowedSelectChild"
1355
+ DISALLOWED_OPT_GROUP_CHILD = "DisallowedOptGroupChild"
1356
+ NON_PHRASING_CONTENT_OPTION_CHILD = "NonPhrasingContentOptionChild"
1357
+ INTERACTIVE_CONTENT_OPTION_CHILD = "InteractiveContentOptionChild"
1358
+ INTERACTIVE_CONTENT_LEGEND_CHILD = "InteractiveContentLegendChild"
1359
+ INTERACTIVE_CONTENT_SUMMARY_DESCENDANT = "InteractiveContentSummaryDescendant"
1360
+
1361
+ def to_json(self) -> str:
1362
+ return self.value
1363
+
1364
+ @classmethod
1365
+ def from_json(cls, json: str) -> ElementAccessibilityIssueReason:
1366
+ return cls(json)
1367
+
1368
+
1369
+ @dataclass
1370
+ class ElementAccessibilityIssueDetails:
1371
+ '''
1372
+ This issue warns about errors in the select or summary element content model.
1373
+ '''
1374
+ node_id: dom.BackendNodeId
1375
+
1376
+ element_accessibility_issue_reason: ElementAccessibilityIssueReason
1377
+
1378
+ has_disallowed_attributes: bool
1379
+
1380
+ def to_json(self) -> T_JSON_DICT:
1381
+ json: T_JSON_DICT = dict()
1382
+ json['nodeId'] = self.node_id.to_json()
1383
+ json['elementAccessibilityIssueReason'] = self.element_accessibility_issue_reason.to_json()
1384
+ json['hasDisallowedAttributes'] = self.has_disallowed_attributes
1385
+ return json
1386
+
1387
+ @classmethod
1388
+ def from_json(cls, json: T_JSON_DICT) -> ElementAccessibilityIssueDetails:
1389
+ return cls(
1390
+ node_id=dom.BackendNodeId.from_json(json['nodeId']),
1391
+ element_accessibility_issue_reason=ElementAccessibilityIssueReason.from_json(json['elementAccessibilityIssueReason']),
1392
+ has_disallowed_attributes=bool(json['hasDisallowedAttributes']),
1393
+ )
1394
+
1395
+
1396
+ class StyleSheetLoadingIssueReason(enum.Enum):
1397
+ LATE_IMPORT_RULE = "LateImportRule"
1398
+ REQUEST_FAILED = "RequestFailed"
1399
+
1400
+ def to_json(self) -> str:
1401
+ return self.value
1402
+
1403
+ @classmethod
1404
+ def from_json(cls, json: str) -> StyleSheetLoadingIssueReason:
1405
+ return cls(json)
1406
+
1407
+
1408
+ @dataclass
1409
+ class StylesheetLoadingIssueDetails:
1410
+ '''
1411
+ This issue warns when a referenced stylesheet couldn't be loaded.
1412
+ '''
1413
+ #: Source code position that referenced the failing stylesheet.
1414
+ source_code_location: SourceCodeLocation
1415
+
1416
+ #: Reason why the stylesheet couldn't be loaded.
1417
+ style_sheet_loading_issue_reason: StyleSheetLoadingIssueReason
1418
+
1419
+ #: Contains additional info when the failure was due to a request.
1420
+ failed_request_info: typing.Optional[FailedRequestInfo] = None
1421
+
1422
+ def to_json(self) -> T_JSON_DICT:
1423
+ json: T_JSON_DICT = dict()
1424
+ json['sourceCodeLocation'] = self.source_code_location.to_json()
1425
+ json['styleSheetLoadingIssueReason'] = self.style_sheet_loading_issue_reason.to_json()
1426
+ if self.failed_request_info is not None:
1427
+ json['failedRequestInfo'] = self.failed_request_info.to_json()
1428
+ return json
1429
+
1430
+ @classmethod
1431
+ def from_json(cls, json: T_JSON_DICT) -> StylesheetLoadingIssueDetails:
1432
+ return cls(
1433
+ source_code_location=SourceCodeLocation.from_json(json['sourceCodeLocation']),
1434
+ style_sheet_loading_issue_reason=StyleSheetLoadingIssueReason.from_json(json['styleSheetLoadingIssueReason']),
1435
+ failed_request_info=FailedRequestInfo.from_json(json['failedRequestInfo']) if json.get('failedRequestInfo', None) is not None else None,
1436
+ )
1437
+
1438
+
1439
+ class PropertyRuleIssueReason(enum.Enum):
1440
+ INVALID_SYNTAX = "InvalidSyntax"
1441
+ INVALID_INITIAL_VALUE = "InvalidInitialValue"
1442
+ INVALID_INHERITS = "InvalidInherits"
1443
+ INVALID_NAME = "InvalidName"
1444
+
1445
+ def to_json(self) -> str:
1446
+ return self.value
1447
+
1448
+ @classmethod
1449
+ def from_json(cls, json: str) -> PropertyRuleIssueReason:
1450
+ return cls(json)
1451
+
1452
+
1453
+ @dataclass
1454
+ class PropertyRuleIssueDetails:
1455
+ '''
1456
+ This issue warns about errors in property rules that lead to property
1457
+ registrations being ignored.
1458
+ '''
1459
+ #: Source code position of the property rule.
1460
+ source_code_location: SourceCodeLocation
1461
+
1462
+ #: Reason why the property rule was discarded.
1463
+ property_rule_issue_reason: PropertyRuleIssueReason
1464
+
1465
+ #: The value of the property rule property that failed to parse
1466
+ property_value: typing.Optional[str] = None
1467
+
1468
+ def to_json(self) -> T_JSON_DICT:
1469
+ json: T_JSON_DICT = dict()
1470
+ json['sourceCodeLocation'] = self.source_code_location.to_json()
1471
+ json['propertyRuleIssueReason'] = self.property_rule_issue_reason.to_json()
1472
+ if self.property_value is not None:
1473
+ json['propertyValue'] = self.property_value
1474
+ return json
1475
+
1476
+ @classmethod
1477
+ def from_json(cls, json: T_JSON_DICT) -> PropertyRuleIssueDetails:
1478
+ return cls(
1479
+ source_code_location=SourceCodeLocation.from_json(json['sourceCodeLocation']),
1480
+ property_rule_issue_reason=PropertyRuleIssueReason.from_json(json['propertyRuleIssueReason']),
1481
+ property_value=str(json['propertyValue']) if json.get('propertyValue', None) is not None else None,
1482
+ )
1483
+
1484
+
1485
+ class UserReidentificationIssueType(enum.Enum):
1486
+ BLOCKED_FRAME_NAVIGATION = "BlockedFrameNavigation"
1487
+ BLOCKED_SUBRESOURCE = "BlockedSubresource"
1488
+ NOISED_CANVAS_READBACK = "NoisedCanvasReadback"
1489
+
1490
+ def to_json(self) -> str:
1491
+ return self.value
1492
+
1493
+ @classmethod
1494
+ def from_json(cls, json: str) -> UserReidentificationIssueType:
1495
+ return cls(json)
1496
+
1497
+
1498
+ @dataclass
1499
+ class UserReidentificationIssueDetails:
1500
+ '''
1501
+ This issue warns about uses of APIs that may be considered misuse to
1502
+ re-identify users.
1503
+ '''
1504
+ type_: UserReidentificationIssueType
1505
+
1506
+ #: Applies to BlockedFrameNavigation and BlockedSubresource issue types.
1507
+ request: typing.Optional[AffectedRequest] = None
1508
+
1509
+ #: Applies to NoisedCanvasReadback issue type.
1510
+ source_code_location: typing.Optional[SourceCodeLocation] = None
1511
+
1512
+ def to_json(self) -> T_JSON_DICT:
1513
+ json: T_JSON_DICT = dict()
1514
+ json['type'] = self.type_.to_json()
1515
+ if self.request is not None:
1516
+ json['request'] = self.request.to_json()
1517
+ if self.source_code_location is not None:
1518
+ json['sourceCodeLocation'] = self.source_code_location.to_json()
1519
+ return json
1520
+
1521
+ @classmethod
1522
+ def from_json(cls, json: T_JSON_DICT) -> UserReidentificationIssueDetails:
1523
+ return cls(
1524
+ type_=UserReidentificationIssueType.from_json(json['type']),
1525
+ request=AffectedRequest.from_json(json['request']) if json.get('request', None) is not None else None,
1526
+ source_code_location=SourceCodeLocation.from_json(json['sourceCodeLocation']) if json.get('sourceCodeLocation', None) is not None else None,
1527
+ )
1528
+
1529
+
1530
+ class PermissionElementIssueType(enum.Enum):
1531
+ INVALID_TYPE = "InvalidType"
1532
+ FENCED_FRAME_DISALLOWED = "FencedFrameDisallowed"
1533
+ CSP_FRAME_ANCESTORS_MISSING = "CspFrameAncestorsMissing"
1534
+ PERMISSIONS_POLICY_BLOCKED = "PermissionsPolicyBlocked"
1535
+ PADDING_RIGHT_UNSUPPORTED = "PaddingRightUnsupported"
1536
+ PADDING_BOTTOM_UNSUPPORTED = "PaddingBottomUnsupported"
1537
+ INSET_BOX_SHADOW_UNSUPPORTED = "InsetBoxShadowUnsupported"
1538
+ REQUEST_IN_PROGRESS = "RequestInProgress"
1539
+ UNTRUSTED_EVENT = "UntrustedEvent"
1540
+ REGISTRATION_FAILED = "RegistrationFailed"
1541
+ TYPE_NOT_SUPPORTED = "TypeNotSupported"
1542
+ INVALID_TYPE_ACTIVATION = "InvalidTypeActivation"
1543
+ SECURITY_CHECKS_FAILED = "SecurityChecksFailed"
1544
+ ACTIVATION_DISABLED = "ActivationDisabled"
1545
+ GEOLOCATION_DEPRECATED = "GeolocationDeprecated"
1546
+ INVALID_DISPLAY_STYLE = "InvalidDisplayStyle"
1547
+ NON_OPAQUE_COLOR = "NonOpaqueColor"
1548
+ LOW_CONTRAST = "LowContrast"
1549
+ FONT_SIZE_TOO_SMALL = "FontSizeTooSmall"
1550
+ FONT_SIZE_TOO_LARGE = "FontSizeTooLarge"
1551
+ INVALID_SIZE_VALUE = "InvalidSizeValue"
1552
+
1553
+ def to_json(self) -> str:
1554
+ return self.value
1555
+
1556
+ @classmethod
1557
+ def from_json(cls, json: str) -> PermissionElementIssueType:
1558
+ return cls(json)
1559
+
1560
+
1561
+ @dataclass
1562
+ class PermissionElementIssueDetails:
1563
+ '''
1564
+ This issue warns about improper usage of the <permission> element.
1565
+ '''
1566
+ issue_type: PermissionElementIssueType
1567
+
1568
+ #: The value of the type attribute.
1569
+ type_: typing.Optional[str] = None
1570
+
1571
+ #: The node ID of the <permission> element.
1572
+ node_id: typing.Optional[dom.BackendNodeId] = None
1573
+
1574
+ #: True if the issue is a warning, false if it is an error.
1575
+ is_warning: typing.Optional[bool] = None
1576
+
1577
+ #: Fields for message construction:
1578
+ #: Used for messages that reference a specific permission name
1579
+ permission_name: typing.Optional[str] = None
1580
+
1581
+ #: Used for messages about occlusion
1582
+ occluder_node_info: typing.Optional[str] = None
1583
+
1584
+ #: Used for messages about occluder's parent
1585
+ occluder_parent_node_info: typing.Optional[str] = None
1586
+
1587
+ #: Used for messages about activation disabled reason
1588
+ disable_reason: typing.Optional[str] = None
1589
+
1590
+ def to_json(self) -> T_JSON_DICT:
1591
+ json: T_JSON_DICT = dict()
1592
+ json['issueType'] = self.issue_type.to_json()
1593
+ if self.type_ is not None:
1594
+ json['type'] = self.type_
1595
+ if self.node_id is not None:
1596
+ json['nodeId'] = self.node_id.to_json()
1597
+ if self.is_warning is not None:
1598
+ json['isWarning'] = self.is_warning
1599
+ if self.permission_name is not None:
1600
+ json['permissionName'] = self.permission_name
1601
+ if self.occluder_node_info is not None:
1602
+ json['occluderNodeInfo'] = self.occluder_node_info
1603
+ if self.occluder_parent_node_info is not None:
1604
+ json['occluderParentNodeInfo'] = self.occluder_parent_node_info
1605
+ if self.disable_reason is not None:
1606
+ json['disableReason'] = self.disable_reason
1607
+ return json
1608
+
1609
+ @classmethod
1610
+ def from_json(cls, json: T_JSON_DICT) -> PermissionElementIssueDetails:
1611
+ return cls(
1612
+ issue_type=PermissionElementIssueType.from_json(json['issueType']),
1613
+ type_=str(json['type']) if json.get('type', None) is not None else None,
1614
+ node_id=dom.BackendNodeId.from_json(json['nodeId']) if json.get('nodeId', None) is not None else None,
1615
+ is_warning=bool(json['isWarning']) if json.get('isWarning', None) is not None else None,
1616
+ permission_name=str(json['permissionName']) if json.get('permissionName', None) is not None else None,
1617
+ occluder_node_info=str(json['occluderNodeInfo']) if json.get('occluderNodeInfo', None) is not None else None,
1618
+ occluder_parent_node_info=str(json['occluderParentNodeInfo']) if json.get('occluderParentNodeInfo', None) is not None else None,
1619
+ disable_reason=str(json['disableReason']) if json.get('disableReason', None) is not None else None,
1620
+ )
1621
+
1622
+
1623
+ @dataclass
1624
+ class SelectivePermissionsInterventionIssueDetails:
1625
+ '''
1626
+ The issue warns about blocked calls to privacy sensitive APIs via the
1627
+ Selective Permissions Intervention.
1628
+ '''
1629
+ #: Which API was intervened on.
1630
+ api_name: str
1631
+
1632
+ #: Why the ad script using the API is considered an ad.
1633
+ ad_ancestry: network.AdAncestry
1634
+
1635
+ #: The stack trace at the time of the intervention.
1636
+ stack_trace: typing.Optional[runtime.StackTrace] = None
1637
+
1638
+ def to_json(self) -> T_JSON_DICT:
1639
+ json: T_JSON_DICT = dict()
1640
+ json['apiName'] = self.api_name
1641
+ json['adAncestry'] = self.ad_ancestry.to_json()
1642
+ if self.stack_trace is not None:
1643
+ json['stackTrace'] = self.stack_trace.to_json()
1644
+ return json
1645
+
1646
+ @classmethod
1647
+ def from_json(cls, json: T_JSON_DICT) -> SelectivePermissionsInterventionIssueDetails:
1648
+ return cls(
1649
+ api_name=str(json['apiName']),
1650
+ ad_ancestry=network.AdAncestry.from_json(json['adAncestry']),
1651
+ stack_trace=runtime.StackTrace.from_json(json['stackTrace']) if json.get('stackTrace', None) is not None else None,
1652
+ )
1653
+
1654
+
1655
+ class InspectorIssueCode(enum.Enum):
1656
+ '''
1657
+ A unique identifier for the type of issue. Each type may use one of the
1658
+ optional fields in InspectorIssueDetails to convey more specific
1659
+ information about the kind of issue.
1660
+ '''
1661
+ COOKIE_ISSUE = "CookieIssue"
1662
+ MIXED_CONTENT_ISSUE = "MixedContentIssue"
1663
+ BLOCKED_BY_RESPONSE_ISSUE = "BlockedByResponseIssue"
1664
+ HEAVY_AD_ISSUE = "HeavyAdIssue"
1665
+ CONTENT_SECURITY_POLICY_ISSUE = "ContentSecurityPolicyIssue"
1666
+ SHARED_ARRAY_BUFFER_ISSUE = "SharedArrayBufferIssue"
1667
+ CORS_ISSUE = "CorsIssue"
1668
+ ATTRIBUTION_REPORTING_ISSUE = "AttributionReportingIssue"
1669
+ QUIRKS_MODE_ISSUE = "QuirksModeIssue"
1670
+ PARTITIONING_BLOB_URL_ISSUE = "PartitioningBlobURLIssue"
1671
+ NAVIGATOR_USER_AGENT_ISSUE = "NavigatorUserAgentIssue"
1672
+ GENERIC_ISSUE = "GenericIssue"
1673
+ DEPRECATION_ISSUE = "DeprecationIssue"
1674
+ CLIENT_HINT_ISSUE = "ClientHintIssue"
1675
+ FEDERATED_AUTH_REQUEST_ISSUE = "FederatedAuthRequestIssue"
1676
+ BOUNCE_TRACKING_ISSUE = "BounceTrackingIssue"
1677
+ COOKIE_DEPRECATION_METADATA_ISSUE = "CookieDeprecationMetadataIssue"
1678
+ STYLESHEET_LOADING_ISSUE = "StylesheetLoadingIssue"
1679
+ FEDERATED_AUTH_USER_INFO_REQUEST_ISSUE = "FederatedAuthUserInfoRequestIssue"
1680
+ PROPERTY_RULE_ISSUE = "PropertyRuleIssue"
1681
+ SHARED_DICTIONARY_ISSUE = "SharedDictionaryIssue"
1682
+ ELEMENT_ACCESSIBILITY_ISSUE = "ElementAccessibilityIssue"
1683
+ SRI_MESSAGE_SIGNATURE_ISSUE = "SRIMessageSignatureIssue"
1684
+ UNENCODED_DIGEST_ISSUE = "UnencodedDigestIssue"
1685
+ CONNECTION_ALLOWLIST_ISSUE = "ConnectionAllowlistIssue"
1686
+ USER_REIDENTIFICATION_ISSUE = "UserReidentificationIssue"
1687
+ PERMISSION_ELEMENT_ISSUE = "PermissionElementIssue"
1688
+ PERFORMANCE_ISSUE = "PerformanceIssue"
1689
+ SELECTIVE_PERMISSIONS_INTERVENTION_ISSUE = "SelectivePermissionsInterventionIssue"
1690
+
1691
+ def to_json(self) -> str:
1692
+ return self.value
1693
+
1694
+ @classmethod
1695
+ def from_json(cls, json: str) -> InspectorIssueCode:
1696
+ return cls(json)
1697
+
1698
+
1699
+ @dataclass
1700
+ class InspectorIssueDetails:
1701
+ '''
1702
+ This struct holds a list of optional fields with additional information
1703
+ specific to the kind of issue. When adding a new issue code, please also
1704
+ add a new optional field to this type.
1705
+ '''
1706
+ cookie_issue_details: typing.Optional[CookieIssueDetails] = None
1707
+
1708
+ mixed_content_issue_details: typing.Optional[MixedContentIssueDetails] = None
1709
+
1710
+ blocked_by_response_issue_details: typing.Optional[BlockedByResponseIssueDetails] = None
1711
+
1712
+ heavy_ad_issue_details: typing.Optional[HeavyAdIssueDetails] = None
1713
+
1714
+ content_security_policy_issue_details: typing.Optional[ContentSecurityPolicyIssueDetails] = None
1715
+
1716
+ shared_array_buffer_issue_details: typing.Optional[SharedArrayBufferIssueDetails] = None
1717
+
1718
+ cors_issue_details: typing.Optional[CorsIssueDetails] = None
1719
+
1720
+ attribution_reporting_issue_details: typing.Optional[AttributionReportingIssueDetails] = None
1721
+
1722
+ quirks_mode_issue_details: typing.Optional[QuirksModeIssueDetails] = None
1723
+
1724
+ partitioning_blob_url_issue_details: typing.Optional[PartitioningBlobURLIssueDetails] = None
1725
+
1726
+ navigator_user_agent_issue_details: typing.Optional[NavigatorUserAgentIssueDetails] = None
1727
+
1728
+ generic_issue_details: typing.Optional[GenericIssueDetails] = None
1729
+
1730
+ deprecation_issue_details: typing.Optional[DeprecationIssueDetails] = None
1731
+
1732
+ client_hint_issue_details: typing.Optional[ClientHintIssueDetails] = None
1733
+
1734
+ federated_auth_request_issue_details: typing.Optional[FederatedAuthRequestIssueDetails] = None
1735
+
1736
+ bounce_tracking_issue_details: typing.Optional[BounceTrackingIssueDetails] = None
1737
+
1738
+ cookie_deprecation_metadata_issue_details: typing.Optional[CookieDeprecationMetadataIssueDetails] = None
1739
+
1740
+ stylesheet_loading_issue_details: typing.Optional[StylesheetLoadingIssueDetails] = None
1741
+
1742
+ property_rule_issue_details: typing.Optional[PropertyRuleIssueDetails] = None
1743
+
1744
+ federated_auth_user_info_request_issue_details: typing.Optional[FederatedAuthUserInfoRequestIssueDetails] = None
1745
+
1746
+ shared_dictionary_issue_details: typing.Optional[SharedDictionaryIssueDetails] = None
1747
+
1748
+ element_accessibility_issue_details: typing.Optional[ElementAccessibilityIssueDetails] = None
1749
+
1750
+ sri_message_signature_issue_details: typing.Optional[SRIMessageSignatureIssueDetails] = None
1751
+
1752
+ unencoded_digest_issue_details: typing.Optional[UnencodedDigestIssueDetails] = None
1753
+
1754
+ connection_allowlist_issue_details: typing.Optional[ConnectionAllowlistIssueDetails] = None
1755
+
1756
+ user_reidentification_issue_details: typing.Optional[UserReidentificationIssueDetails] = None
1757
+
1758
+ permission_element_issue_details: typing.Optional[PermissionElementIssueDetails] = None
1759
+
1760
+ performance_issue_details: typing.Optional[PerformanceIssueDetails] = None
1761
+
1762
+ selective_permissions_intervention_issue_details: typing.Optional[SelectivePermissionsInterventionIssueDetails] = None
1763
+
1764
+ def to_json(self) -> T_JSON_DICT:
1765
+ json: T_JSON_DICT = dict()
1766
+ if self.cookie_issue_details is not None:
1767
+ json['cookieIssueDetails'] = self.cookie_issue_details.to_json()
1768
+ if self.mixed_content_issue_details is not None:
1769
+ json['mixedContentIssueDetails'] = self.mixed_content_issue_details.to_json()
1770
+ if self.blocked_by_response_issue_details is not None:
1771
+ json['blockedByResponseIssueDetails'] = self.blocked_by_response_issue_details.to_json()
1772
+ if self.heavy_ad_issue_details is not None:
1773
+ json['heavyAdIssueDetails'] = self.heavy_ad_issue_details.to_json()
1774
+ if self.content_security_policy_issue_details is not None:
1775
+ json['contentSecurityPolicyIssueDetails'] = self.content_security_policy_issue_details.to_json()
1776
+ if self.shared_array_buffer_issue_details is not None:
1777
+ json['sharedArrayBufferIssueDetails'] = self.shared_array_buffer_issue_details.to_json()
1778
+ if self.cors_issue_details is not None:
1779
+ json['corsIssueDetails'] = self.cors_issue_details.to_json()
1780
+ if self.attribution_reporting_issue_details is not None:
1781
+ json['attributionReportingIssueDetails'] = self.attribution_reporting_issue_details.to_json()
1782
+ if self.quirks_mode_issue_details is not None:
1783
+ json['quirksModeIssueDetails'] = self.quirks_mode_issue_details.to_json()
1784
+ if self.partitioning_blob_url_issue_details is not None:
1785
+ json['partitioningBlobURLIssueDetails'] = self.partitioning_blob_url_issue_details.to_json()
1786
+ if self.navigator_user_agent_issue_details is not None:
1787
+ json['navigatorUserAgentIssueDetails'] = self.navigator_user_agent_issue_details.to_json()
1788
+ if self.generic_issue_details is not None:
1789
+ json['genericIssueDetails'] = self.generic_issue_details.to_json()
1790
+ if self.deprecation_issue_details is not None:
1791
+ json['deprecationIssueDetails'] = self.deprecation_issue_details.to_json()
1792
+ if self.client_hint_issue_details is not None:
1793
+ json['clientHintIssueDetails'] = self.client_hint_issue_details.to_json()
1794
+ if self.federated_auth_request_issue_details is not None:
1795
+ json['federatedAuthRequestIssueDetails'] = self.federated_auth_request_issue_details.to_json()
1796
+ if self.bounce_tracking_issue_details is not None:
1797
+ json['bounceTrackingIssueDetails'] = self.bounce_tracking_issue_details.to_json()
1798
+ if self.cookie_deprecation_metadata_issue_details is not None:
1799
+ json['cookieDeprecationMetadataIssueDetails'] = self.cookie_deprecation_metadata_issue_details.to_json()
1800
+ if self.stylesheet_loading_issue_details is not None:
1801
+ json['stylesheetLoadingIssueDetails'] = self.stylesheet_loading_issue_details.to_json()
1802
+ if self.property_rule_issue_details is not None:
1803
+ json['propertyRuleIssueDetails'] = self.property_rule_issue_details.to_json()
1804
+ if self.federated_auth_user_info_request_issue_details is not None:
1805
+ json['federatedAuthUserInfoRequestIssueDetails'] = self.federated_auth_user_info_request_issue_details.to_json()
1806
+ if self.shared_dictionary_issue_details is not None:
1807
+ json['sharedDictionaryIssueDetails'] = self.shared_dictionary_issue_details.to_json()
1808
+ if self.element_accessibility_issue_details is not None:
1809
+ json['elementAccessibilityIssueDetails'] = self.element_accessibility_issue_details.to_json()
1810
+ if self.sri_message_signature_issue_details is not None:
1811
+ json['sriMessageSignatureIssueDetails'] = self.sri_message_signature_issue_details.to_json()
1812
+ if self.unencoded_digest_issue_details is not None:
1813
+ json['unencodedDigestIssueDetails'] = self.unencoded_digest_issue_details.to_json()
1814
+ if self.connection_allowlist_issue_details is not None:
1815
+ json['connectionAllowlistIssueDetails'] = self.connection_allowlist_issue_details.to_json()
1816
+ if self.user_reidentification_issue_details is not None:
1817
+ json['userReidentificationIssueDetails'] = self.user_reidentification_issue_details.to_json()
1818
+ if self.permission_element_issue_details is not None:
1819
+ json['permissionElementIssueDetails'] = self.permission_element_issue_details.to_json()
1820
+ if self.performance_issue_details is not None:
1821
+ json['performanceIssueDetails'] = self.performance_issue_details.to_json()
1822
+ if self.selective_permissions_intervention_issue_details is not None:
1823
+ json['selectivePermissionsInterventionIssueDetails'] = self.selective_permissions_intervention_issue_details.to_json()
1824
+ return json
1825
+
1826
+ @classmethod
1827
+ def from_json(cls, json: T_JSON_DICT) -> InspectorIssueDetails:
1828
+ return cls(
1829
+ cookie_issue_details=CookieIssueDetails.from_json(json['cookieIssueDetails']) if json.get('cookieIssueDetails', None) is not None else None,
1830
+ mixed_content_issue_details=MixedContentIssueDetails.from_json(json['mixedContentIssueDetails']) if json.get('mixedContentIssueDetails', None) is not None else None,
1831
+ blocked_by_response_issue_details=BlockedByResponseIssueDetails.from_json(json['blockedByResponseIssueDetails']) if json.get('blockedByResponseIssueDetails', None) is not None else None,
1832
+ heavy_ad_issue_details=HeavyAdIssueDetails.from_json(json['heavyAdIssueDetails']) if json.get('heavyAdIssueDetails', None) is not None else None,
1833
+ content_security_policy_issue_details=ContentSecurityPolicyIssueDetails.from_json(json['contentSecurityPolicyIssueDetails']) if json.get('contentSecurityPolicyIssueDetails', None) is not None else None,
1834
+ shared_array_buffer_issue_details=SharedArrayBufferIssueDetails.from_json(json['sharedArrayBufferIssueDetails']) if json.get('sharedArrayBufferIssueDetails', None) is not None else None,
1835
+ cors_issue_details=CorsIssueDetails.from_json(json['corsIssueDetails']) if json.get('corsIssueDetails', None) is not None else None,
1836
+ attribution_reporting_issue_details=AttributionReportingIssueDetails.from_json(json['attributionReportingIssueDetails']) if json.get('attributionReportingIssueDetails', None) is not None else None,
1837
+ quirks_mode_issue_details=QuirksModeIssueDetails.from_json(json['quirksModeIssueDetails']) if json.get('quirksModeIssueDetails', None) is not None else None,
1838
+ partitioning_blob_url_issue_details=PartitioningBlobURLIssueDetails.from_json(json['partitioningBlobURLIssueDetails']) if json.get('partitioningBlobURLIssueDetails', None) is not None else None,
1839
+ navigator_user_agent_issue_details=NavigatorUserAgentIssueDetails.from_json(json['navigatorUserAgentIssueDetails']) if json.get('navigatorUserAgentIssueDetails', None) is not None else None,
1840
+ generic_issue_details=GenericIssueDetails.from_json(json['genericIssueDetails']) if json.get('genericIssueDetails', None) is not None else None,
1841
+ deprecation_issue_details=DeprecationIssueDetails.from_json(json['deprecationIssueDetails']) if json.get('deprecationIssueDetails', None) is not None else None,
1842
+ client_hint_issue_details=ClientHintIssueDetails.from_json(json['clientHintIssueDetails']) if json.get('clientHintIssueDetails', None) is not None else None,
1843
+ federated_auth_request_issue_details=FederatedAuthRequestIssueDetails.from_json(json['federatedAuthRequestIssueDetails']) if json.get('federatedAuthRequestIssueDetails', None) is not None else None,
1844
+ bounce_tracking_issue_details=BounceTrackingIssueDetails.from_json(json['bounceTrackingIssueDetails']) if json.get('bounceTrackingIssueDetails', None) is not None else None,
1845
+ cookie_deprecation_metadata_issue_details=CookieDeprecationMetadataIssueDetails.from_json(json['cookieDeprecationMetadataIssueDetails']) if json.get('cookieDeprecationMetadataIssueDetails', None) is not None else None,
1846
+ stylesheet_loading_issue_details=StylesheetLoadingIssueDetails.from_json(json['stylesheetLoadingIssueDetails']) if json.get('stylesheetLoadingIssueDetails', None) is not None else None,
1847
+ property_rule_issue_details=PropertyRuleIssueDetails.from_json(json['propertyRuleIssueDetails']) if json.get('propertyRuleIssueDetails', None) is not None else None,
1848
+ federated_auth_user_info_request_issue_details=FederatedAuthUserInfoRequestIssueDetails.from_json(json['federatedAuthUserInfoRequestIssueDetails']) if json.get('federatedAuthUserInfoRequestIssueDetails', None) is not None else None,
1849
+ shared_dictionary_issue_details=SharedDictionaryIssueDetails.from_json(json['sharedDictionaryIssueDetails']) if json.get('sharedDictionaryIssueDetails', None) is not None else None,
1850
+ element_accessibility_issue_details=ElementAccessibilityIssueDetails.from_json(json['elementAccessibilityIssueDetails']) if json.get('elementAccessibilityIssueDetails', None) is not None else None,
1851
+ sri_message_signature_issue_details=SRIMessageSignatureIssueDetails.from_json(json['sriMessageSignatureIssueDetails']) if json.get('sriMessageSignatureIssueDetails', None) is not None else None,
1852
+ unencoded_digest_issue_details=UnencodedDigestIssueDetails.from_json(json['unencodedDigestIssueDetails']) if json.get('unencodedDigestIssueDetails', None) is not None else None,
1853
+ connection_allowlist_issue_details=ConnectionAllowlistIssueDetails.from_json(json['connectionAllowlistIssueDetails']) if json.get('connectionAllowlistIssueDetails', None) is not None else None,
1854
+ user_reidentification_issue_details=UserReidentificationIssueDetails.from_json(json['userReidentificationIssueDetails']) if json.get('userReidentificationIssueDetails', None) is not None else None,
1855
+ permission_element_issue_details=PermissionElementIssueDetails.from_json(json['permissionElementIssueDetails']) if json.get('permissionElementIssueDetails', None) is not None else None,
1856
+ performance_issue_details=PerformanceIssueDetails.from_json(json['performanceIssueDetails']) if json.get('performanceIssueDetails', None) is not None else None,
1857
+ selective_permissions_intervention_issue_details=SelectivePermissionsInterventionIssueDetails.from_json(json['selectivePermissionsInterventionIssueDetails']) if json.get('selectivePermissionsInterventionIssueDetails', None) is not None else None,
1858
+ )
1859
+
1860
+
1861
+ class IssueId(str):
1862
+ '''
1863
+ A unique id for a DevTools inspector issue. Allows other entities (e.g.
1864
+ exceptions, CDP message, console messages, etc.) to reference an issue.
1865
+ '''
1866
+ def to_json(self) -> str:
1867
+ return self
1868
+
1869
+ @classmethod
1870
+ def from_json(cls, json: str) -> IssueId:
1871
+ return cls(json)
1872
+
1873
+ def __repr__(self):
1874
+ return 'IssueId({})'.format(super().__repr__())
1875
+
1876
+
1877
+ @dataclass
1878
+ class InspectorIssue:
1879
+ '''
1880
+ An inspector issue reported from the back-end.
1881
+ '''
1882
+ code: InspectorIssueCode
1883
+
1884
+ details: InspectorIssueDetails
1885
+
1886
+ #: A unique id for this issue. May be omitted if no other entity (e.g.
1887
+ #: exception, CDP message, etc.) is referencing this issue.
1888
+ issue_id: typing.Optional[IssueId] = None
1889
+
1890
+ def to_json(self) -> T_JSON_DICT:
1891
+ json: T_JSON_DICT = dict()
1892
+ json['code'] = self.code.to_json()
1893
+ json['details'] = self.details.to_json()
1894
+ if self.issue_id is not None:
1895
+ json['issueId'] = self.issue_id.to_json()
1896
+ return json
1897
+
1898
+ @classmethod
1899
+ def from_json(cls, json: T_JSON_DICT) -> InspectorIssue:
1900
+ return cls(
1901
+ code=InspectorIssueCode.from_json(json['code']),
1902
+ details=InspectorIssueDetails.from_json(json['details']),
1903
+ issue_id=IssueId.from_json(json['issueId']) if json.get('issueId', None) is not None else None,
1904
+ )
1905
+
1906
+
1907
+ def get_encoded_response(
1908
+ request_id: network.RequestId,
1909
+ encoding: str,
1910
+ quality: typing.Optional[float] = None,
1911
+ size_only: typing.Optional[bool] = None
1912
+ ) -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.Tuple[typing.Optional[str], int, int]]:
1913
+ '''
1914
+ Returns the response body and size if it were re-encoded with the specified settings. Only
1915
+ applies to images.
1916
+
1917
+ :param request_id: Identifier of the network request to get content for.
1918
+ :param encoding: The encoding to use.
1919
+ :param quality: *(Optional)* The quality of the encoding (0-1). (defaults to 1)
1920
+ :param size_only: *(Optional)* Whether to only return the size information (defaults to false).
1921
+ :returns: A tuple with the following items:
1922
+
1923
+ 0. **body** - *(Optional)* The encoded body as a base64 string. Omitted if sizeOnly is true. (Encoded as a base64 string when passed over JSON)
1924
+ 1. **originalSize** - Size before re-encoding.
1925
+ 2. **encodedSize** - Size after re-encoding.
1926
+ '''
1927
+ params: T_JSON_DICT = dict()
1928
+ params['requestId'] = request_id.to_json()
1929
+ params['encoding'] = encoding
1930
+ if quality is not None:
1931
+ params['quality'] = quality
1932
+ if size_only is not None:
1933
+ params['sizeOnly'] = size_only
1934
+ cmd_dict: T_JSON_DICT = {
1935
+ 'method': 'Audits.getEncodedResponse',
1936
+ 'params': params,
1937
+ }
1938
+ json = yield cmd_dict
1939
+ return (
1940
+ str(json['body']) if json.get('body', None) is not None else None,
1941
+ int(json['originalSize']),
1942
+ int(json['encodedSize'])
1943
+ )
1944
+
1945
+
1946
+ def disable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
1947
+ '''
1948
+ Disables issues domain, prevents further issues from being reported to the client.
1949
+ '''
1950
+ cmd_dict: T_JSON_DICT = {
1951
+ 'method': 'Audits.disable',
1952
+ }
1953
+ json = yield cmd_dict
1954
+
1955
+
1956
+ def enable() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,None]:
1957
+ '''
1958
+ Enables issues domain, sends the issues collected so far to the client by means of the
1959
+ ``issueAdded`` event.
1960
+ '''
1961
+ cmd_dict: T_JSON_DICT = {
1962
+ 'method': 'Audits.enable',
1963
+ }
1964
+ json = yield cmd_dict
1965
+
1966
+
1967
+ def check_forms_issues() -> typing.Generator[T_JSON_DICT,T_JSON_DICT,typing.List[GenericIssueDetails]]:
1968
+ '''
1969
+ Runs the form issues check for the target page. Found issues are reported
1970
+ using Audits.issueAdded event.
1971
+
1972
+ :returns:
1973
+ '''
1974
+ cmd_dict: T_JSON_DICT = {
1975
+ 'method': 'Audits.checkFormsIssues',
1976
+ }
1977
+ json = yield cmd_dict
1978
+ return [GenericIssueDetails.from_json(i) for i in json['formIssues']]
1979
+
1980
+
1981
+ @event_class('Audits.issueAdded')
1982
+ @dataclass
1983
+ class IssueAdded:
1984
+ issue: InspectorIssue
1985
+
1986
+ @classmethod
1987
+ def from_json(cls, json: T_JSON_DICT) -> IssueAdded:
1988
+ return cls(
1989
+ issue=InspectorIssue.from_json(json['issue'])
1990
+ )