chrome-devtools-frontend 1.0.1566234 → 1.0.1567721

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 (188) hide show
  1. package/docs/contributing/performance.md +24 -0
  2. package/front_end/core/common/Base64.ts +21 -2
  3. package/front_end/core/common/ResourceType.ts +7 -0
  4. package/front_end/core/host/InspectorFrontendHostStub.ts +3 -0
  5. package/front_end/core/host/UserMetrics.ts +20 -0
  6. package/front_end/core/sdk/NetworkManager.ts +3 -3
  7. package/front_end/entrypoints/main/MainImpl.ts +1 -7
  8. package/front_end/generated/Deprecation.ts +0 -8
  9. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  10. package/front_end/generated/SupportedCSSProperties.js +39 -49
  11. package/front_end/generated/protocol.ts +4 -0
  12. package/front_end/models/ai_assistance/agents/AiAgent.ts +2 -1
  13. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +98 -105
  14. package/front_end/models/emulation/DeviceModeModel.ts +1 -1
  15. package/front_end/models/formatter/FormatterWorkerPool.ts +8 -6
  16. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -9
  17. package/front_end/models/persistence/PersistenceImpl.ts +8 -0
  18. package/front_end/models/text_utils/TextUtils.snapshot.txt +83 -0
  19. package/front_end/panels/ai_assistance/ai_assistance-meta.ts +0 -1
  20. package/front_end/panels/ai_assistance/components/ArtifactsViewer.ts +28 -4
  21. package/front_end/panels/ai_assistance/components/ChatView.ts +52 -169
  22. package/front_end/panels/ai_assistance/components/CollapsibleAssistanceContentWidget.ts +27 -8
  23. package/front_end/panels/ai_assistance/components/PerformanceAgentMarkdownRenderer.ts +19 -4
  24. package/front_end/panels/application/ApplicationPanelSidebar.ts +1 -0
  25. package/front_end/panels/application/DeviceBoundSessionsModel.ts +42 -0
  26. package/front_end/panels/application/DeviceBoundSessionsTreeElement.ts +60 -11
  27. package/front_end/panels/application/DeviceBoundSessionsView.ts +947 -103
  28. package/front_end/panels/application/ResourcesPanel.ts +7 -0
  29. package/front_end/panels/application/deviceBoundSessionsView.css +10 -1
  30. package/front_end/panels/common/AiCodeGenerationUpgradeDialog.ts +115 -0
  31. package/front_end/panels/common/aiCodeGenerationUpgradeDialog.css +79 -0
  32. package/front_end/panels/common/common.ts +1 -0
  33. package/front_end/panels/console/ConsoleInsightTeaser.ts +17 -3
  34. package/front_end/panels/issues/AffectedSourcesView.ts +0 -1
  35. package/front_end/panels/issues/IssuesPane.ts +0 -4
  36. package/front_end/panels/network/RequestTimingView.ts +5 -20
  37. package/front_end/panels/network/networkTimingTable.css +5 -5
  38. package/front_end/panels/recorder/components/StepEditor.ts +15 -8
  39. package/front_end/panels/settings/AISettingsTab.ts +31 -2
  40. package/front_end/panels/sources/InplaceFormatterEditorAction.ts +8 -6
  41. package/front_end/panels/sources/UISourceCodeFrame.ts +9 -3
  42. package/front_end/panels/timeline/TimelinePanel.ts +12 -4
  43. package/front_end/panels/timeline/components/insights/DuplicatedJavaScript.ts +1 -1
  44. package/front_end/third_party/chromium/README.chromium +1 -1
  45. package/front_end/third_party/puppeteer/README.chromium +2 -2
  46. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts +9 -2
  47. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.d.ts.map +1 -1
  48. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Browser.js.map +1 -1
  49. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +8 -0
  50. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
  51. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js +8 -0
  52. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
  53. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts +2 -1
  54. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.d.ts.map +1 -1
  55. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js +2 -2
  56. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Browser.js.map +1 -1
  57. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  58. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js +3 -1
  59. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/BrowserContext.js.map +1 -1
  60. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.d.ts.map +1 -1
  61. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js +1 -1
  62. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Frame.js.map +1 -1
  63. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  64. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js +3 -3
  65. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  66. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts +1 -0
  67. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  68. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js +1 -0
  69. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/core/UserContext.js.map +1 -1
  70. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
  71. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +1 -0
  72. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
  73. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
  74. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +33 -31
  75. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
  76. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts +2 -2
  77. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  78. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js +1 -4
  79. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/WebWorker.js.map +1 -1
  80. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts +7 -1
  81. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  82. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js +11 -1
  83. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ConsoleMessage.js.map +1 -1
  84. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Cookie.d.ts +2 -2
  85. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
  86. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
  87. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
  88. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
  89. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
  90. package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
  91. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +13 -4
  92. package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +62 -42
  93. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts +9 -2
  94. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.d.ts.map +1 -1
  95. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Browser.js.map +1 -1
  96. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +8 -0
  97. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
  98. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js +8 -0
  99. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
  100. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts +2 -1
  101. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.d.ts.map +1 -1
  102. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js +2 -2
  103. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Browser.js.map +1 -1
  104. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.d.ts.map +1 -1
  105. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js +3 -1
  106. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/BrowserContext.js.map +1 -1
  107. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.d.ts.map +1 -1
  108. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js +1 -1
  109. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Frame.js.map +1 -1
  110. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
  111. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js +3 -3
  112. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
  113. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts +1 -0
  114. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.d.ts.map +1 -1
  115. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js +1 -0
  116. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/core/UserContext.js.map +1 -1
  117. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
  118. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +1 -0
  119. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
  120. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
  121. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +33 -31
  122. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
  123. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts +2 -2
  124. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.d.ts.map +1 -1
  125. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js +1 -4
  126. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/WebWorker.js.map +1 -1
  127. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts +7 -1
  128. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.d.ts.map +1 -1
  129. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js +11 -1
  130. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ConsoleMessage.js.map +1 -1
  131. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Cookie.d.ts +2 -2
  132. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
  133. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
  134. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
  135. package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
  136. package/front_end/third_party/puppeteer/package/lib/types.d.ts +13 -4
  137. package/front_end/third_party/puppeteer/package/package.json +3 -3
  138. package/front_end/third_party/puppeteer/package/src/api/Browser.ts +11 -3
  139. package/front_end/third_party/puppeteer/package/src/api/Page.ts +9 -0
  140. package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +3 -3
  141. package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +3 -1
  142. package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -0
  143. package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +3 -5
  144. package/front_end/third_party/puppeteer/package/src/bidi/core/UserContext.ts +2 -0
  145. package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +1 -0
  146. package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +43 -45
  147. package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +3 -11
  148. package/front_end/third_party/puppeteer/package/src/common/ConsoleMessage.ts +12 -0
  149. package/front_end/third_party/puppeteer/package/src/common/Cookie.ts +2 -2
  150. package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
  151. package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
  152. package/front_end/third_party/source-map-scopes-codec/README.chromium +2 -5
  153. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts +1 -1
  154. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/builder.d.ts.map +1 -1
  155. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts +1 -1
  156. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/builder/safe_builder.d.ts.map +1 -1
  157. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts +1 -1
  158. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/decode/decode.d.ts.map +1 -1
  159. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts +1 -1
  160. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/encode/encode.d.ts.map +1 -1
  161. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts +1 -1
  162. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/mod.d.ts.map +1 -1
  163. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts +130 -0
  164. package/front_end/third_party/source-map-scopes-codec/package/_dist/src/scopes.d.ts.map +1 -0
  165. package/front_end/third_party/source-map-scopes-codec/package/deno.json +1 -1
  166. package/front_end/third_party/source-map-scopes-codec/package/package.json +1 -1
  167. package/front_end/third_party/source-map-scopes-codec/package/src/builder/builder.ts +1 -1
  168. package/front_end/third_party/source-map-scopes-codec/package/src/builder/safe_builder.ts +1 -1
  169. package/front_end/third_party/source-map-scopes-codec/package/src/codec.js +4 -0
  170. package/front_end/third_party/source-map-scopes-codec/package/src/codec.js.map +1 -1
  171. package/front_end/third_party/source-map-scopes-codec/package/src/codec.ts +4 -0
  172. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js +30 -13
  173. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.js.map +1 -1
  174. package/front_end/third_party/source-map-scopes-codec/package/src/decode/decode.ts +35 -17
  175. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encode.ts +1 -1
  176. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js +1 -1
  177. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.js.map +1 -1
  178. package/front_end/third_party/source-map-scopes-codec/package/src/encode/encoder.ts +2 -2
  179. package/front_end/third_party/source-map-scopes-codec/package/src/mod.ts +1 -1
  180. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js +7 -0
  181. package/front_end/third_party/source-map-scopes-codec/package/src/scopes.js.map +1 -0
  182. package/front_end/third_party/source-map-scopes-codec/package/src/util.ts +1 -1
  183. package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +4 -0
  184. package/front_end/ui/visual_logging/KnownContextValues.ts +11 -0
  185. package/mcp/mcp.ts +1 -0
  186. package/package.json +1 -2
  187. package/front_end/third_party/source-map-scopes-codec/package/src/scopes-tsconfig.json +0 -8
  188. /package/front_end/third_party/source-map-scopes-codec/package/src/{scopes.d.ts → scopes.ts} +0 -0
@@ -5,10 +5,11 @@
5
5
  import '../../ui/components/report_view/report_view.js';
6
6
  import '../../ui/legacy/components/data_grid/data_grid.js';
7
7
 
8
+ import type * as Common from '../../core/common/common.js';
8
9
  import * as i18n from '../../core/i18n/i18n.js';
9
10
  import * as Protocol from '../../generated/protocol.js';
10
11
  import * as UI from '../../ui/legacy/legacy.js';
11
- import {html, nothing, render} from '../../ui/lit/lit.js';
12
+ import {Directives, html, nothing, render, type TemplateResult} from '../../ui/lit/lit.js';
12
13
  import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
13
14
 
14
15
  import {
@@ -17,6 +18,7 @@ import {
17
18
  type SessionAndEvents
18
19
  } from './DeviceBoundSessionsModel.js';
19
20
  import deviceBoundSessionsViewStyles from './deviceBoundSessionsView.css.js';
21
+ const {widgetConfig} = UI.Widget;
20
22
 
21
23
  const UIStrings = {
22
24
  /**
@@ -95,128 +97,691 @@ const UIStrings = {
95
97
  *@description Text describing that a rule includes something.
96
98
  */
97
99
  ruleTypeInclude: 'Include',
100
+ /**
101
+ *@description Label for an event that has created something.
102
+ */
103
+ creation: 'Creation',
104
+ /**
105
+ *@description Label for an event that has refreshed something.
106
+ */
107
+ refresh: 'Refresh',
108
+ /**
109
+ *@description Label for an event that has set a cryptographic string challenge.
110
+ */
111
+ challenge: 'Challenge',
112
+ /**
113
+ *@description Label for an event that has terminated something.
114
+ */
115
+ termination: 'Termination',
116
+ /**
117
+ *@description Label for an event whose type is not known.
118
+ */
119
+ unknown: 'Unknown',
120
+ /**
121
+ *@description Heading for a section that will display events that have occurred.
122
+ */
123
+ events: 'Events',
124
+ /**
125
+ *@description Section header for details about an event.
126
+ */
127
+ eventDetails: 'Event details',
128
+ /**
129
+ *@description Placeholder text when no row is selected in a table of events.
130
+ */
131
+ selectEventToViewDetails: 'Select an event row to view more details.',
132
+ /**
133
+ *@description Column heading for the type of event that has occurred.
134
+ */
135
+ type: 'Type',
136
+ /**
137
+ *@description Column heading for the date + time that an event occurred.
138
+ */
139
+ timestamp: 'Date',
140
+ /**
141
+ *@description Column heading for the result of an event (whether it succeeded or had an error).
142
+ */
143
+ result: 'Result',
144
+ /**
145
+ *@description Notes the result status of an event was that it succeeded.
146
+ */
147
+ success: 'Success',
148
+ /**
149
+ *@description Notes the result status of an event was that it had an error.
150
+ */
151
+ error: 'Error',
152
+ /**
153
+ *@description Default message when no events have appeared yet.
154
+ */
155
+ noEvents: 'No events have been logged yet.',
156
+ /**
157
+ *@description Text to preserve the log of events after refreshing.
158
+ */
159
+ preserveLog: 'Preserve log',
160
+ /**
161
+ *@description Tooltip text that appears on the preserve log setting when hovering over it.
162
+ */
163
+ doNotClearLogOnPageReload: 'Do not clear log on page reload/navigation.',
164
+ /**
165
+ *@description Label for the ID of a session.
166
+ */
167
+ sessionId: 'Session ID',
168
+ /**
169
+ *@description Label for the result of an event (whether it succeeded or had an error).
170
+ */
171
+ eventResult: 'Event result',
172
+ /**
173
+ *@description Label for the result of fetching new session information.
174
+ */
175
+ fetchResult: 'Fetch result',
176
+ /**
177
+ *@description Label for whether a session's basic configuration was updated. The corresponding value is yes or no.
178
+ */
179
+ updatedSessionConfig: 'Updated session config',
180
+ /**
181
+ *@description Label for the result of an attempted refresh.
182
+ */
183
+ refreshResult: 'Refresh result',
184
+ /**
185
+ *@description Label for whether a particular event caused any HTTP request to be deferred (i.e. paused and
186
+ * later unpaused). The corresponding value is yes or no.
187
+ */
188
+ causedAnyRequestDeferrals: 'Caused any request deferrals',
189
+ /**
190
+ *@description Label for the result of attempting to set a cryptographic string challenge.
191
+ */
192
+ challengeResult: 'Challenge result',
193
+ /**
194
+ *@description Label for the reason why a session was deleted.
195
+ */
196
+ deletionReason: 'Deletion reason',
197
+ /**
198
+ *@description Explanation for an event outcome. Key refers to a cryptographic key.
199
+ */
200
+ keyError: 'Key error',
201
+ /**
202
+ *@description Explanation for an event outcome. Signing refers to cryptographic signing.
203
+ */
204
+ signingError: 'Signing error',
205
+ /**
206
+ *@description Explanation for an event outcome.
207
+ */
208
+ serverRequestedTermination: 'Server requested termination',
209
+ /**
210
+ *@description Explanation for an event outcome.
211
+ */
212
+ invalidSessionId: 'Invalid session ID',
213
+ /**
214
+ *@description Explanation for an event outcome. Challenge refers to a cryptographic string challenge.
215
+ */
216
+ invalidChallenge: 'Invalid challenge',
217
+ /**
218
+ *@description Explanation for an event outcome. Challenge refers to a cryptographic string challenge.
219
+ */
220
+ tooManyChallenges: 'Too many challenges',
221
+ /**
222
+ *@description Explanation for an event outcome.
223
+ */
224
+ invalidFetcherUrl: 'Invalid fetcher URL',
225
+ /**
226
+ *@description Explanation for an event outcome.
227
+ */
228
+ invalidRefreshUrl: 'Invalid refresh URL',
229
+ /**
230
+ *@description Explanation for an event outcome.
231
+ */
232
+ transientHttpError: 'Transient HTTP error',
233
+ /**
234
+ *@description Explanation for an event outcome. This means there is a URL origin written into a session configuration's scope that is causing failures because it's for a different site.
235
+ */
236
+ scopeOriginSameSiteMismatch: 'Same-site mismatch scope origin',
237
+ /**
238
+ *@description Explanation for an event outcome. This means the session configuration's URL for refreshing is causing failures because it's for a different site.
239
+ */
240
+ refreshUrlSameSiteMismatch: 'Same-site mismatch refresh URL',
241
+ /**
242
+ *@description Explanation for an event outcome. This means the session configuration's session ID does not match the relevant session ID.
243
+ */
244
+ mismatchedSessionId: 'Mismatched session ID',
245
+ /**
246
+ *@description Explanation for an event outcome.
247
+ */
248
+ missingScope: 'Missing scope',
249
+ /**
250
+ *@description Explanation for an event outcome. This means the credentials field in the session configuration is missing.
251
+ */
252
+ noCredentials: 'No credentials',
253
+ /**
254
+ *@description Explanation for an event outcome.
255
+ */
256
+ subdomainRegistrationWellKnownUnavailable: 'Subdomain registration .well-known unavailable',
257
+ /**
258
+ *@description Explanation for an event outcome.
259
+ */
260
+ subdomainRegistrationUnauthorized: '.well-known did not authorize registration by subdomain',
261
+ /**
262
+ *@description Explanation for an event outcome.
263
+ */
264
+ subdomainRegistrationWellKnownMalformed: 'Subdomain registration .well-known content malformed',
265
+ /**
266
+ *@description Explanation for an event outcome.
267
+ */
268
+ sessionProviderWellKnownUnavailable: 'Session provider .well-known unavailable',
269
+ /**
270
+ *@description Explanation for an event outcome.
271
+ */
272
+ relyingPartyWellKnownUnavailable: 'Relying party .well-known unavailable',
273
+ /**
274
+ *@description Explanation for an event outcome. This refers to a JSON Web Key thumbprint (https://www.rfc-editor.org/rfc/rfc7638). Federated sessions are described in https://w3c.github.io/webappsec-dbsc/.
275
+ */
276
+ federatedKeyThumbprintMismatch: 'Federated key had incorrect thumbprint',
277
+ /**
278
+ *@description Explanation for an event outcome. Federated sessions are described in https://w3c.github.io/webappsec-dbsc/.
279
+ */
280
+ invalidFederatedSessionUrl: 'Federated provider URL not valid',
281
+ /**
282
+ *@description Explanation for an event outcome. Federated sessions are described in https://w3c.github.io/webappsec-dbsc/.
283
+ */
284
+ invalidFederatedKey: 'Federated key invalid',
285
+ /**
286
+ *@description Explanation for an event outcome. Origin labels are described in https://w3c.github.io/webappsec-dbsc/.
287
+ */
288
+ tooManyRelyingOriginLabels: 'Too many relying origin labels in .well-known',
289
+ /**
290
+ *@description Explanation for an event outcome.
291
+ */
292
+ boundCookieSetForbidden: 'Registration in a context that cannot set bound cookies',
293
+ /**
294
+ *@description Explanation for an event outcome.
295
+ */
296
+ netError: 'Network error',
297
+ /**
298
+ *@description Explanation for an event outcome.
299
+ */
300
+ proxyError: 'Proxy error',
301
+ /**
302
+ *@description Explanation for an event outcome.
303
+ */
304
+ emptySessionConfig: 'Empty session configuration for registration',
305
+ /**
306
+ *@description Explanation for an event outcome.
307
+ */
308
+ invalidCredentialsConfig: 'Invalid credentials configuration',
309
+ /**
310
+ *@description Explanation for an event outcome.
311
+ */
312
+ invalidCredentialsType: 'Invalid credentials - empty or non-cookie type',
313
+ /**
314
+ *@description Explanation for an event outcome.
315
+ */
316
+ invalidCredentialsEmptyName: 'Invalid credentials - empty name',
317
+ /**
318
+ *@description Explanation for an event outcome.
319
+ */
320
+ invalidCredentialsCookie: 'Invalid credentials - cookie invalid',
321
+ /**
322
+ *@description Explanation for an event outcome.
323
+ */
324
+ persistentHttpError: 'Persistent HTTP error',
325
+ /**
326
+ *@description Explanation for an event outcome. Challenge refers to a cryptographic string challenge.
327
+ */
328
+ registrationAttemptedChallenge: 'Registration returned challenge error response code',
329
+ /**
330
+ *@description Explanation for an event outcome. This refers to a URL's origin.
331
+ */
332
+ invalidScopeOrigin: 'Invalid scope origin',
333
+ /**
334
+ *@description Explanation for an event outcome. This refers to an URL's path / origin.
335
+ */
336
+ scopeOriginContainsPath: 'Scope origin contains a path',
337
+ /**
338
+ *@description Explanation for an event outcome. This refers to an HTTP request's initiator.
339
+ */
340
+ refreshInitiatorNotString: 'Allowed refresh initiator is not a string',
341
+ /**
342
+ *@description Explanation for an event outcome. This refers to an HTTP request's initiator and a URL's host.
343
+ */
344
+ refreshInitiatorInvalidHostPattern: 'Allowed refresh initiator has invalid host pattern',
345
+ /**
346
+ *@description Explanation for an event outcome. Scope specification is defined in https://w3c.github.io/webappsec-dbsc/.
347
+ */
348
+ invalidScopeSpecification: 'Invalid scope specification',
349
+ /**
350
+ *@description Explanation for an event outcome. Scope specification is defined in https://w3c.github.io/webappsec-dbsc/.
351
+ */
352
+ missingScopeSpecificationType: 'Missing scope specification type',
353
+ /**
354
+ *@description Explanation for an event outcome. Scope specification is defined in https://w3c.github.io/webappsec-dbsc/.
355
+ */
356
+ emptyScopeSpecificationDomain: 'Empty scope specification domain',
357
+ /**
358
+ *@description Explanation for an event outcome. Scope specification is defined in https://w3c.github.io/webappsec-dbsc/.
359
+ */
360
+ emptyScopeSpecificationPath: 'Empty scope specification path',
361
+ /**
362
+ *@description Explanation for an event outcome. Scope specification is defined in https://w3c.github.io/webappsec-dbsc/.
363
+ */
364
+ invalidScopeSpecificationType: 'Scope specification type is neiher include or exclude',
365
+ /**
366
+ *@description Explanation for an event outcome. Scope specification is defined in https://w3c.github.io/webappsec-dbsc/.
367
+ */
368
+ invalidScopeIncludeSite: 'Invalid include_site in scope',
369
+ /**
370
+ *@description Explanation for an event outcome. Scope specification is defined in https://w3c.github.io/webappsec-dbsc/.
371
+ */
372
+ missingScopeIncludeSite: 'Missing include_site in scope',
373
+ /**
374
+ *@description Explanation for an event outcome. Federated sessions are defined in https://w3c.github.io/webappsec-dbsc/.
375
+ */
376
+ federatedNotAuthorizedByProvider: 'Federated session not authorized by provider .well-known',
377
+ /**
378
+ *@description Explanation for an event outcome. Federated sessions are defined in https://w3c.github.io/webappsec-dbsc/.
379
+ */
380
+ federatedNotAuthorizedByRelyingParty: 'Federated session not authorized by relying party .well-known',
381
+ /**
382
+ *@description Explanation for an event outcome. Federated sessions are defined in https://w3c.github.io/webappsec-dbsc/.
383
+ */
384
+ sessionProviderWellKnownMalformed: 'Session provider .well-known content malformed',
385
+ /**
386
+ *@description Explanation for an event outcome. Federated sessions are defined in https://w3c.github.io/webappsec-dbsc/.
387
+ */
388
+ sessionProviderWellKnownHasProviderOrigin: 'Session provider .well-known content has provider_origin',
389
+ /**
390
+ *@description Explanation for an event outcome. Federated sessions are defined in https://w3c.github.io/webappsec-dbsc/.
391
+ */
392
+ relyingPartyWellKnownMalformed: 'Relying party .well-known content malformed',
393
+ /**
394
+ *@description Explanation for an event outcome. Federated sessions are defined in https://w3c.github.io/webappsec-dbsc/.
395
+ */
396
+ relyingPartyWellKnownHasRelyingOrigins: 'Relying party .well-known content has relying_origins',
397
+ /**
398
+ *@description Explanation for an event outcome. Federated sessions are defined in https://w3c.github.io/webappsec-dbsc/.
399
+ */
400
+ invalidFederatedSessionProviderSessionMissing: 'Federated session invalid due to provider session not found',
401
+ /**
402
+ *@description Explanation for an event outcome. Federated sessions are defined in https://w3c.github.io/webappsec-dbsc/.
403
+ */
404
+ invalidFederatedSessionWrongProviderOrigin: 'Federated session invalid due to provider origin mismatch',
405
+ /**
406
+ *@description Explanation for an event outcome.
407
+ */
408
+ invalidCredentialsCookieCreationTime: 'Invalid credentials - cookie creation time invalid',
409
+ /**
410
+ *@description Explanation for an event outcome.
411
+ */
412
+ invalidCredentialsCookieName: 'Invalid credentials - cookie name invalid',
413
+ /**
414
+ *@description Explanation for an event outcome.
415
+ */
416
+ invalidCredentialsCookieParsing: 'Invalid credentials - cookie parsing failed',
417
+ /**
418
+ *@description Explanation for an event outcome.
419
+ */
420
+ invalidCredentialsCookieUnpermittedAttribute: 'Invalid credentials - cookie attribute not permitted',
421
+ /**
422
+ *@description Explanation for an event outcome.
423
+ */
424
+ invalidCredentialsCookieInvalidDomain: 'Invalid credentials - cookie invalid domain',
425
+ /**
426
+ *@description Explanation for an event outcome.
427
+ */
428
+ invalidCredentialsCookiePrefix: 'Invalid credentials - cookie invalid prefix',
429
+ /**
430
+ *@description Explanation for an event outcome. Scope specification is defined in https://w3c.github.io/webappsec-dbsc/.
431
+ */
432
+ invalidScopeRulePath: 'Invalid scope rule path',
433
+ /**
434
+ *@description Explanation for an event outcome. Scope specification is defined in https://w3c.github.io/webappsec-dbsc/.
435
+ */
436
+ invalidScopeRuleHostPattern: 'Invalid scope rule host pattern',
437
+ /**
438
+ *@description Explanation for an event outcome. A session can be scoped to just a specific URL origin. This error means that the session's origin does not match the provided URL host pattern.
439
+ */
440
+ scopeRuleOriginScopedHostPatternMismatch: 'Origin-scoped session has mismatch between host pattern and origin',
441
+ /**
442
+ *@description Explanation for an event outcome. A session can be scoped to an entire site. This error means that the session's site does not match the provided URL host pattern.
443
+ */
444
+ scopeRuleSiteScopedHostPatternMismatch: 'Site-scoped session has mismatch between host pattern and site',
445
+ /**
446
+ *@description Explanation for an event outcome. This refers to cryptographic signing.
447
+ */
448
+ signingQuotaExceeded: 'Signing quota exceeded',
449
+ /**
450
+ *@description Explanation for an event outcome.
451
+ */
452
+ invalidConfigJson: 'Invalid session configuration JSON',
453
+ /**
454
+ *@description Explanation for an event outcome. Federated sessions are defined in https://w3c.github.io/webappsec-dbsc/. Key refers to a cryptographic key.
455
+ */
456
+ invalidFederatedSessionProviderFailedToRestoreKey:
457
+ 'Federated session invalid due to failure to restore session provider key',
458
+ /**
459
+ *@description Explanation for an event outcome. Key refers to a cryptographic key.
460
+ */
461
+ failedToUnwrapKey: 'Failed to unwrap key',
462
+ /**
463
+ *@description Explanation for an event outcome.
464
+ */
465
+ sessionDeletedDuringRefresh: 'Session deleted during refresh',
466
+ /**
467
+ *@description Explanation for an event outcome.
468
+ */
469
+ refreshed: 'Refreshed',
470
+ /**
471
+ *@description Explanation for an event outcome.
472
+ */
473
+ initializedService: 'Service initialized',
474
+ /**
475
+ *@description Explanation for an event outcome.
476
+ */
477
+ unreachable: 'Endpoint unreachable',
478
+ /**
479
+ *@description Explanation for an event outcome.
480
+ */
481
+ serverError: 'Endpoint transient error',
482
+ /**
483
+ *@description Explanation for an event outcome.
484
+ */
485
+ refreshQuotaExceeded: 'Refresh quota exceeded',
486
+ /**
487
+ *@description Explanation for an event outcome.
488
+ */
489
+ fatalError: 'Fatal error',
490
+ /**
491
+ *@description Explanation for an event outcome.
492
+ */
493
+ noSessionId: 'No session ID',
494
+ /**
495
+ *@description Explanation for an event outcome.
496
+ */
497
+ noSessionMatch: 'No matching session ID',
498
+ /**
499
+ *@description Explanation for an event outcome.
500
+ */
501
+ cantSetBoundCookie: 'Not allowed to set bound cookie',
502
+ /**
503
+ *@description Explanation for an event outcome.
504
+ */
505
+ expired: 'Expired',
506
+ /**
507
+ *@description Explanation for an event outcome. Key refers to a cryptographic key. This means there was an attempt to read a key from disk but it failed.
508
+ */
509
+ failedToRestoreKey: 'Failed to restore key from disk',
510
+ /**
511
+ *@description Explanation for an event outcome.
512
+ */
513
+ storagePartitionCleared: 'Removed from storage partition',
514
+ /**
515
+ *@description Explanation for an event outcome.
516
+ */
517
+ clearBrowsingData: 'User-initiated browser data removal',
518
+ /**
519
+ *@description Explanation for an event outcome.
520
+ */
521
+ invalidSessionParams: 'Invalid session parameters',
522
+ /**
523
+ *@description Explanation for an event outcome.
524
+ */
525
+ refreshFatalError: 'Fatal error during refresh',
98
526
  } as const;
527
+
99
528
  const str_ = i18n.i18n.registerUIStrings('panels/application/DeviceBoundSessionsView.ts', UIStrings);
100
529
  const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
101
530
 
102
531
  interface ViewInput {
103
532
  sessionAndEvents?: SessionAndEvents;
533
+ preserveLogSetting?: Common.Settings.Setting<boolean>;
534
+ defaultTitle?: string;
535
+ defaultDescription?: string;
536
+ selectedEvent?: Protocol.Network.DeviceBoundSessionEventOccurredEvent;
537
+ onEventRowSelected?(selectedEvent?: Protocol.Network.DeviceBoundSessionEventOccurredEvent|undefined): void;
104
538
  }
105
539
 
106
540
  type ViewOutput = object;
107
541
 
108
- function ruleTypeToString(ruleType: Protocol.Network.DeviceBoundSessionUrlRuleRuleType): string {
109
- switch (ruleType) {
110
- case Protocol.Network.DeviceBoundSessionUrlRuleRuleType.Exclude:
111
- return i18nString(UIStrings.ruleTypeExclude);
112
- case Protocol.Network.DeviceBoundSessionUrlRuleRuleType.Include:
113
- return i18nString(UIStrings.ruleTypeInclude);
114
- default:
115
- return ruleType;
116
- }
117
- }
118
-
119
542
  export const DEFAULT_VIEW = (input: ViewInput, _output: ViewOutput, target: HTMLElement): void => {
120
- const {sessionAndEvents} = input;
543
+ const {sessionAndEvents, preserveLogSetting, defaultTitle, defaultDescription, selectedEvent, onEventRowSelected} =
544
+ input;
121
545
 
122
- if (!sessionAndEvents?.session) {
123
- render(nothing, target);
546
+ const toolbarHtml = preserveLogSetting ?
547
+ html`
548
+ <devtools-toolbar class="device-bound-sessions-toolbar">
549
+ <devtools-checkbox title=${i18nString(UIStrings.doNotClearLogOnPageReload)} ${
550
+ UI.UIUtils.bindToSetting(preserveLogSetting)}>${i18nString(UIStrings.preserveLog)}</devtools-checkbox>
551
+ </devtools-toolbar>
552
+ ` :
553
+ nothing;
554
+
555
+ if (!sessionAndEvents) {
556
+ if (!defaultTitle || !defaultDescription) {
557
+ render(nothing, target);
558
+ return;
559
+ }
560
+ render(
561
+ html`
562
+ <style>${UI.inspectorCommonStyles}</style>
563
+ <style>${deviceBoundSessionsViewStyles}</style>
564
+ ${toolbarHtml}
565
+ <devtools-widget .widgetConfig=${widgetConfig(UI.EmptyWidget.EmptyWidget, {
566
+ header: defaultTitle,
567
+ text: defaultDescription
568
+ })} jslog=${VisualLogging.pane('device-bound-sessions-empty')}></devtools-widget>
569
+ `,
570
+ target);
124
571
  return;
125
572
  }
126
573
 
127
- const {key, inclusionRules, cookieCravings} = sessionAndEvents.session;
128
- const sessionDetails = html`
129
- <devtools-report>
130
- <devtools-report-section-header>${i18nString(UIStrings.sessionConfig)}</devtools-report-section-header>
131
- <devtools-report-key>${i18nString(UIStrings.keySite)}</devtools-report-key>
132
- <devtools-report-value>${key.site}</devtools-report-value>
133
- <devtools-report-key>${i18nString(UIStrings.keyId)}</devtools-report-key>
134
- <devtools-report-value>${key.id}</devtools-report-value>
135
- <devtools-report-key>${i18nString(UIStrings.refreshUrl)}</devtools-report-key>
136
- <devtools-report-value>${sessionAndEvents.session.refreshUrl}</devtools-report-value>
137
- <devtools-report-key>${i18nString(UIStrings.expiryDate)}</devtools-report-key>
138
- <devtools-report-value>${
139
- new Date(sessionAndEvents.session.expiryDate * 1000).toLocaleString()}</devtools-report-value>
140
- <devtools-report-key>${i18nString(UIStrings.cachedChallenge)}</devtools-report-key>
141
- <devtools-report-value>${sessionAndEvents.session.cachedChallenge || ''}</devtools-report-value>
142
- <devtools-report-key>${i18nString(UIStrings.allowedRefreshInitiators)}</devtools-report-key>
143
- <devtools-report-value>${sessionAndEvents.session.allowedRefreshInitiators.join(', ')}</devtools-report-value>
144
- <devtools-report-section-header>${i18nString(UIStrings.scope)}</devtools-report-section-header>
145
- <devtools-report-key>${i18nString(UIStrings.origin)}</devtools-report-key>
146
- <devtools-report-value>${inclusionRules.origin}</devtools-report-value>
147
- <devtools-report-key>${i18nString(UIStrings.includeSite)}</devtools-report-key>
148
- <devtools-report-value>${
149
- inclusionRules.includeSite ? i18nString(UIStrings.yes) : i18nString(UIStrings.no)}</devtools-report-value>
150
- </devtools-report>
151
- ${
152
- inclusionRules.urlRules.length > 0 ? html`
153
- <div class="device-bound-session-grid-wrapper">
154
- <devtools-data-grid class="device-bound-session-url-rules-grid" striped inline>
155
- <table>
156
- <thead>
157
- <tr>
158
- <th id="should-include" weight="1" sortable>${i18nString(UIStrings.ruleType)}</th>
159
- <th id="host-pattern" weight="2" sortable>${i18nString(UIStrings.ruleHostPattern)}</th>
160
- <th id="path-prefix" weight="2" sortable>${i18nString(UIStrings.rulePathPrefix)}</th>
161
- </tr>
162
- </thead>
163
- <tbody>
164
- ${inclusionRules.urlRules.map(rule => html`
574
+ let sessionDetailsHtml: TemplateResult|undefined;
575
+ if (sessionAndEvents.session) {
576
+ const {key, inclusionRules, cookieCravings} = sessionAndEvents.session;
577
+ sessionDetailsHtml = html`
578
+ <devtools-report>
579
+ <devtools-report-section-header>${i18nString(UIStrings.sessionConfig)}</devtools-report-section-header>
580
+ <devtools-report-key>${i18nString(UIStrings.keySite)}</devtools-report-key>
581
+ <devtools-report-value>${key.site}</devtools-report-value>
582
+ <devtools-report-key>${i18nString(UIStrings.keyId)}</devtools-report-key>
583
+ <devtools-report-value>${key.id}</devtools-report-value>
584
+ <devtools-report-key>${i18nString(UIStrings.refreshUrl)}</devtools-report-key>
585
+ <devtools-report-value>${sessionAndEvents.session.refreshUrl}</devtools-report-value>
586
+ <devtools-report-key>${i18nString(UIStrings.expiryDate)}</devtools-report-key>
587
+ <devtools-report-value>${
588
+ new Date(sessionAndEvents.session.expiryDate * 1000).toLocaleString()}</devtools-report-value>
589
+ <devtools-report-key>${i18nString(UIStrings.cachedChallenge)}</devtools-report-key>
590
+ <devtools-report-value>${sessionAndEvents.session.cachedChallenge || ''}</devtools-report-value>
591
+ <devtools-report-key>${i18nString(UIStrings.allowedRefreshInitiators)}</devtools-report-key>
592
+ <devtools-report-value>${sessionAndEvents.session.allowedRefreshInitiators.join(', ')}</devtools-report-value>
593
+ <devtools-report-section-header>${i18nString(UIStrings.scope)}</devtools-report-section-header>
594
+ <devtools-report-key>${i18nString(UIStrings.origin)}</devtools-report-key>
595
+ <devtools-report-value>${inclusionRules.origin}</devtools-report-value>
596
+ <devtools-report-key>${i18nString(UIStrings.includeSite)}</devtools-report-key>
597
+ <devtools-report-value>${boolToString(inclusionRules.includeSite)}</devtools-report-value>
598
+ </devtools-report>
599
+ ${
600
+ inclusionRules.urlRules.length > 0 ? html`
601
+ <div class="device-bound-session-grid-wrapper">
602
+ <devtools-data-grid class="device-bound-session-url-rules-grid" striped inline>
603
+ <table>
604
+ <thead>
165
605
  <tr>
166
- <td>${ruleTypeToString(rule.ruleType)}</td>
167
- <td>${rule.hostPattern}</td>
168
- <td>${rule.pathPrefix}</td>
606
+ <th id="should-include" weight="1" sortable>${i18nString(UIStrings.ruleType)}</th>
607
+ <th id="host-pattern" weight="2" sortable>${i18nString(UIStrings.ruleHostPattern)}</th>
608
+ <th id="path-prefix" weight="2" sortable>${i18nString(UIStrings.rulePathPrefix)}</th>
169
609
  </tr>
170
- `)}
171
- </tbody>
172
- </table>
173
- </devtools-data-grid>
174
- </div>
175
- ` :
176
- nothing}
177
- <devtools-report-section-header>${i18nString(UIStrings.cookieCravings)}</devtools-report-section-header>
178
- ${
179
- cookieCravings.length > 0 ? html`
180
- <div class="device-bound-session-grid-wrapper">
181
- <devtools-data-grid class="device-bound-session-cookie-cravings-grid" striped inline>
182
- <table>
183
- <thead>
184
- <tr>
185
- <th id="name" weight="2" sortable>${i18nString(UIStrings.name)}</th>
186
- <th id="domain" weight="2" sortable>${i18n.i18n.lockedString('Domain')}</th>
187
- <th id="path" weight="2" sortable>${i18n.i18n.lockedString('Path')}</th>
188
- <th id="secure" type="boolean" align="center" weight="1" sortable>${
189
- i18n.i18n.lockedString('Secure')}</th>
190
- <th id="http-only" type="boolean" align="center" weight="1" sortable>${
191
- i18n.i18n.lockedString('HttpOnly')}</th>
192
- <th id="same-site" weight="1" sortable>${i18n.i18n.lockedString('SameSite')}</th>
193
- </tr>
194
- </thead>
195
- <tbody>
196
- ${cookieCravings.map(craving => html`
610
+ </thead>
611
+ <tbody>
612
+ ${inclusionRules.urlRules.map(rule => html`
613
+ <tr>
614
+ <td>${ruleTypeToString(rule.ruleType)}</td>
615
+ <td>${rule.hostPattern}</td>
616
+ <td>${rule.pathPrefix}</td>
617
+ </tr>
618
+ `)}
619
+ </tbody>
620
+ </table>
621
+ </devtools-data-grid>
622
+ </div>
623
+ ` :
624
+ nothing}
625
+ <devtools-report-section-header>${i18nString(UIStrings.cookieCravings)}</devtools-report-section-header>
626
+ ${
627
+ cookieCravings.length > 0 ? html`
628
+ <div class="device-bound-session-grid-wrapper">
629
+ <devtools-data-grid class="device-bound-session-cookie-cravings-grid" striped inline>
630
+ <table>
631
+ <thead>
197
632
  <tr>
198
- <td>${craving.name}</td>
199
- <td>${craving.domain}</td>
200
- <td>${craving.path}</td>
201
- <td>${craving.secure}</td>
202
- <td>${craving.httpOnly}</td>
203
- <td>${craving.sameSite}</td>
633
+ <th id="name" weight="2" sortable>${i18nString(UIStrings.name)}</th>
634
+ <th id="domain" weight="2" sortable>${i18n.i18n.lockedString('Domain')}</th>
635
+ <th id="path" weight="2" sortable>${i18n.i18n.lockedString('Path')}</th>
636
+ <th id="secure" type="boolean" align="center" weight="1" sortable>${
637
+ i18n.i18n.lockedString('Secure')}</th>
638
+ <th id="http-only" type="boolean" align="center" weight="1" sortable>${
639
+ i18n.i18n.lockedString('HttpOnly')}</th>
640
+ <th id="same-site" weight="1" sortable>${i18n.i18n.lockedString('SameSite')}</th>
204
641
  </tr>
205
- `)}
206
- </tbody>
207
- </table>
208
- </devtools-data-grid>
209
- </div>
210
- ` :
211
- nothing}`;
642
+ </thead>
643
+ <tbody>
644
+ ${cookieCravings.map(craving => html`
645
+ <tr>
646
+ <td>${craving.name}</td>
647
+ <td>${craving.domain}</td>
648
+ <td>${craving.path}</td>
649
+ <td>${craving.secure}</td>
650
+ <td>${craving.httpOnly}</td>
651
+ <td>${craving.sameSite}</td>
652
+ </tr>
653
+ `)}
654
+ </tbody>
655
+ </table>
656
+ </devtools-data-grid>
657
+ </div>
658
+ ` :
659
+ nothing}`;
660
+ }
661
+ const events = [...sessionAndEvents.eventsById.values()];
662
+ const eventsHtml = html`
663
+ <devtools-report-section-header>${i18nString(UIStrings.events)}</devtools-report-section-header>
664
+ ${
665
+ events.length > 0 && onEventRowSelected ?
666
+ html`
667
+ <div class="device-bound-session-grid-wrapper">
668
+ <devtools-data-grid class="device-bound-session-events-grid" striped inline ${
669
+ Directives.ref((el?: Element) => {
670
+ if (!el || !(el instanceof HTMLElement)) {
671
+ return;
672
+ }
673
+ const grid = el as HTMLElement & {deselectRow(): void};
674
+ if (!selectedEvent) {
675
+ grid.deselectRow();
676
+ }
677
+ })}>
678
+ <table>
679
+ <thead>
680
+ <tr>
681
+ <th id="type" weight="1" sortable>${i18nString(UIStrings.type)}</th>
682
+ <th id="timestamp" weight="2" sortable>${i18nString(UIStrings.timestamp)}</th>
683
+ <th id="details" weight="2" sortable>${i18nString(UIStrings.result)}</th>
684
+ </tr>
685
+ </thead>
686
+ <tbody>${events.map(({event, timestamp}) => html`
687
+ <tr @select=${(): void => onEventRowSelected(event)}>
688
+ <td>${getEventTypeString(event)}</td>
689
+ <td>${timestamp.toLocaleString()}</td>
690
+ <td>${succeededToString(event.succeeded)}</td>
691
+ </tr>
692
+ `)}
693
+ </tbody>
694
+ </table>
695
+ </devtools-data-grid>
696
+ </div>
697
+ ` :
698
+ html`<div class="device-bound-session-no-events-wrapper">${i18nString(UIStrings.noEvents)}</div>`}`;
699
+
700
+ const creationEventDetails =
701
+ selectedEvent?.creationEventDetails &&
702
+ html`
703
+ <devtools-report-key>${i18nString(UIStrings.fetchResult)}</devtools-report-key>
704
+ <devtools-report-value>${
705
+ fetchResultToString(selectedEvent.creationEventDetails.fetchResult)}</devtools-report-value>
706
+ ${selectedEvent.creationEventDetails.newSession && html`
707
+ <devtools-report-key>${i18nString(UIStrings.updatedSessionConfig)}</devtools-report-key>
708
+ <devtools-report-value>${i18nString(UIStrings.yes)}</devtools-report-value>
709
+ `}
710
+ `;
711
+ const refreshEventDetails =
712
+ selectedEvent?.refreshEventDetails &&
713
+ html`
714
+ <devtools-report-key>${i18nString(UIStrings.refreshResult)}</devtools-report-key>
715
+ <devtools-report-value>${
716
+ refreshResultToString(selectedEvent.refreshEventDetails.refreshResult)}</devtools-report-value>
717
+ <devtools-report-key>${i18nString(UIStrings.causedAnyRequestDeferrals)}</devtools-report-key>
718
+ <devtools-report-value>${
719
+ boolToString(!selectedEvent.refreshEventDetails.wasFullyProactiveRefresh)}</devtools-report-value>
720
+ ${
721
+ selectedEvent.refreshEventDetails.fetchResult &&
722
+ html`
723
+ <devtools-report-key>${i18nString(UIStrings.fetchResult)}</devtools-report-key>
724
+ <devtools-report-value>${
725
+ fetchResultToString(selectedEvent.refreshEventDetails.fetchResult)}</devtools-report-value>
726
+ `}
727
+ ${selectedEvent.refreshEventDetails.newSession && html`
728
+ <devtools-report-key>${i18nString(UIStrings.updatedSessionConfig)}</devtools-report-key>
729
+ <devtools-report-value>${i18nString(UIStrings.yes)}</devtools-report-value>
730
+ `}
731
+ `;
732
+ const challengeEventDetails =
733
+ selectedEvent?.challengeEventDetails &&
734
+ html`
735
+ <devtools-report-key>${i18nString(UIStrings.challengeResult)}</devtools-report-key>
736
+ <devtools-report-value>${
737
+ challengeResultToString(selectedEvent.challengeEventDetails.challengeResult)}</devtools-report-value>
738
+ <devtools-report-key>${i18nString(UIStrings.challenge)}</devtools-report-key>
739
+ <devtools-report-value>${selectedEvent.challengeEventDetails.challenge}</devtools-report-value>
740
+ `;
741
+ const terminationEventDetails =
742
+ selectedEvent?.terminationEventDetails &&
743
+ html`
744
+ <devtools-report-key>${i18nString(UIStrings.deletionReason)}</devtools-report-key>
745
+ <devtools-report-value>${
746
+ deletionReasonToString(selectedEvent.terminationEventDetails.deletionReason)}</devtools-report-value>
747
+ `;
748
+ const eventDetailsContentHtml = selectedEvent ?
749
+ html`
750
+ <devtools-report>
751
+ <devtools-report-key>${i18nString(UIStrings.keySite)}</devtools-report-key>
752
+ <devtools-report-value>${selectedEvent.site}</devtools-report-value>
753
+ <devtools-report-key>${i18nString(UIStrings.sessionId)}</devtools-report-key>
754
+ <devtools-report-value>${selectedEvent.sessionId}</devtools-report-value>
755
+ <devtools-report-key>${i18nString(UIStrings.type)}</devtools-report-key>
756
+ <devtools-report-value>${getEventTypeString(selectedEvent)}</devtools-report-value>
757
+ <devtools-report-key>${i18nString(UIStrings.eventResult)}</devtools-report-key>
758
+ <devtools-report-value>${succeededToString(selectedEvent.succeeded)}</devtools-report-value>
759
+ ${creationEventDetails}
760
+ ${refreshEventDetails}
761
+ ${challengeEventDetails}
762
+ ${terminationEventDetails}
763
+ </devtools-report>
764
+ ` :
765
+ html`<div class="device-bound-session-no-event-details">${i18nString(UIStrings.selectEventToViewDetails)}</div>`;
766
+ const eventDetailsHtml = html`
767
+ <devtools-report-section-header>${i18nString(UIStrings.eventDetails)}</devtools-report-section-header>
768
+ ${eventDetailsContentHtml}
769
+ `;
212
770
 
213
771
  render(
214
772
  html`
215
773
  <style>${UI.inspectorCommonStyles}</style>
216
774
  <style>${deviceBoundSessionsViewStyles}</style>
217
- <div class="device-bound-session-view-wrapper">
218
- ${sessionDetails}
219
- </div>`,
775
+ ${toolbarHtml}
776
+ <devtools-split-view sidebar-position="second">
777
+ <div slot="main" class="device-bound-session-view-wrapper">
778
+ ${sessionDetailsHtml || nothing}
779
+ ${eventsHtml}
780
+ </div>
781
+ <div slot="sidebar" class="device-bound-session-sidebar">
782
+ ${eventDetailsHtml}
783
+ </div>
784
+ </devtools-split-view>`,
220
785
  target);
221
786
  };
222
787
 
@@ -225,6 +790,9 @@ export class DeviceBoundSessionsView extends UI.Widget.VBox {
225
790
  #sessionId?: string;
226
791
  #model?: DeviceBoundSessionsModel;
227
792
  #view: typeof DEFAULT_VIEW;
793
+ #defaultTitle?: string;
794
+ #defaultDescription?: string;
795
+ #selectedEvent?: Protocol.Network.DeviceBoundSessionEventOccurredEvent;
228
796
 
229
797
  constructor(view: typeof DEFAULT_VIEW = DEFAULT_VIEW) {
230
798
  super({jslog: `${VisualLogging.pane('device-bound-sessions')}`});
@@ -232,21 +800,297 @@ export class DeviceBoundSessionsView extends UI.Widget.VBox {
232
800
  }
233
801
 
234
802
  showSession(model: DeviceBoundSessionsModel, site: string, sessionId?: string): void {
803
+ this.#defaultTitle = undefined;
804
+ this.#defaultDescription = undefined;
235
805
  this.#site = site;
236
806
  this.#sessionId = sessionId;
807
+ this.#attachModel(model);
808
+ this.performUpdate();
809
+ }
810
+
811
+ showDefault(model: DeviceBoundSessionsModel, defaultTitle: string, defaultDescription: string): void {
812
+ this.#defaultTitle = defaultTitle;
813
+ this.#defaultDescription = defaultDescription;
814
+ this.#site = undefined;
815
+ this.#sessionId = undefined;
816
+ this.#attachModel(model);
817
+ this.performUpdate();
818
+ }
819
+
820
+ #attachModel(model: DeviceBoundSessionsModel): void {
237
821
  if (this.#model) {
238
822
  this.#model.removeEventListener(DeviceBoundSessionModelEvents.EVENT_OCCURRED, this.performUpdate, this);
823
+ this.#model.removeEventListener(DeviceBoundSessionModelEvents.CLEAR_EVENTS, this.performUpdate, this);
239
824
  }
240
825
  this.#model = model;
241
826
  this.#model.addEventListener(DeviceBoundSessionModelEvents.EVENT_OCCURRED, this.performUpdate, this);
242
- this.performUpdate();
827
+ this.#model.addEventListener(DeviceBoundSessionModelEvents.CLEAR_EVENTS, this.performUpdate, this);
828
+ if (this.#selectedEvent) {
829
+ this.#selectedEvent = undefined;
830
+ }
243
831
  }
244
832
 
245
833
  override performUpdate(): void {
246
834
  let sessionAndEvents: SessionAndEvents|undefined;
247
- if (this.#site && this.#model) {
248
- sessionAndEvents = this.#model.getSession(this.#site, this.#sessionId);
835
+ let preserveLogSetting: Common.Settings.Setting<boolean>|undefined;
836
+
837
+ if (this.#model) {
838
+ preserveLogSetting = this.#model.getPreserveLogSetting();
839
+ if (this.#site) {
840
+ sessionAndEvents = this.#model.getSession(this.#site, this.#sessionId);
841
+ }
249
842
  }
250
- this.#view({sessionAndEvents}, {}, this.contentElement);
843
+
844
+ this.#view(
845
+ {
846
+ sessionAndEvents,
847
+ preserveLogSetting,
848
+ defaultTitle: this.#defaultTitle,
849
+ defaultDescription: this.#defaultDescription,
850
+ selectedEvent: this.#selectedEvent,
851
+ onEventRowSelected: this.#onEventRowSelected.bind(this),
852
+ },
853
+ {}, this.contentElement);
251
854
  }
855
+
856
+ #onEventRowSelected(selectedEvent?: Protocol.Network.DeviceBoundSessionEventOccurredEvent): void {
857
+ this.#selectedEvent = selectedEvent;
858
+ this.performUpdate();
859
+ }
860
+ }
861
+
862
+ function ruleTypeToString(ruleType: Protocol.Network.DeviceBoundSessionUrlRuleRuleType): string {
863
+ switch (ruleType) {
864
+ case Protocol.Network.DeviceBoundSessionUrlRuleRuleType.Exclude:
865
+ return i18nString(UIStrings.ruleTypeExclude);
866
+ case Protocol.Network.DeviceBoundSessionUrlRuleRuleType.Include:
867
+ return i18nString(UIStrings.ruleTypeInclude);
868
+ default:
869
+ return ruleType;
870
+ }
871
+ }
872
+ function getEventTypeString(event: Protocol.Network.DeviceBoundSessionEventOccurredEvent): string {
873
+ if (event.creationEventDetails) {
874
+ return i18nString(UIStrings.creation);
875
+ }
876
+ if (event.refreshEventDetails) {
877
+ return i18nString(UIStrings.refresh);
878
+ }
879
+ if (event.challengeEventDetails) {
880
+ return i18nString(UIStrings.challenge);
881
+ }
882
+ if (event.terminationEventDetails) {
883
+ return i18nString(UIStrings.termination);
884
+ }
885
+ return i18nString(UIStrings.unknown);
886
+ }
887
+
888
+ function fetchResultToString(fetchResult: Protocol.Network.DeviceBoundSessionFetchResult): string {
889
+ switch (fetchResult) {
890
+ case Protocol.Network.DeviceBoundSessionFetchResult.Success:
891
+ return i18nString(UIStrings.success);
892
+ case Protocol.Network.DeviceBoundSessionFetchResult.KeyError:
893
+ return i18nString(UIStrings.keyError);
894
+ case Protocol.Network.DeviceBoundSessionFetchResult.SigningError:
895
+ return i18nString(UIStrings.signingError);
896
+ case Protocol.Network.DeviceBoundSessionFetchResult.ServerRequestedTermination:
897
+ return i18nString(UIStrings.serverRequestedTermination);
898
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidSessionId:
899
+ return i18nString(UIStrings.invalidSessionId);
900
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidChallenge:
901
+ return i18nString(UIStrings.invalidChallenge);
902
+ case Protocol.Network.DeviceBoundSessionFetchResult.TooManyChallenges:
903
+ return i18nString(UIStrings.tooManyChallenges);
904
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidFetcherUrl:
905
+ return i18nString(UIStrings.invalidFetcherUrl);
906
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidRefreshUrl:
907
+ return i18nString(UIStrings.invalidRefreshUrl);
908
+ case Protocol.Network.DeviceBoundSessionFetchResult.TransientHttpError:
909
+ return i18nString(UIStrings.transientHttpError);
910
+ case Protocol.Network.DeviceBoundSessionFetchResult.ScopeOriginSameSiteMismatch:
911
+ return i18nString(UIStrings.scopeOriginSameSiteMismatch);
912
+ case Protocol.Network.DeviceBoundSessionFetchResult.RefreshUrlSameSiteMismatch:
913
+ return i18nString(UIStrings.refreshUrlSameSiteMismatch);
914
+ case Protocol.Network.DeviceBoundSessionFetchResult.MismatchedSessionId:
915
+ return i18nString(UIStrings.mismatchedSessionId);
916
+ case Protocol.Network.DeviceBoundSessionFetchResult.MissingScope:
917
+ return i18nString(UIStrings.missingScope);
918
+ case Protocol.Network.DeviceBoundSessionFetchResult.NoCredentials:
919
+ return i18nString(UIStrings.noCredentials);
920
+ case Protocol.Network.DeviceBoundSessionFetchResult.SubdomainRegistrationWellKnownUnavailable:
921
+ return i18nString(UIStrings.subdomainRegistrationWellKnownUnavailable);
922
+ case Protocol.Network.DeviceBoundSessionFetchResult.SubdomainRegistrationUnauthorized:
923
+ return i18nString(UIStrings.subdomainRegistrationUnauthorized);
924
+ case Protocol.Network.DeviceBoundSessionFetchResult.SubdomainRegistrationWellKnownMalformed:
925
+ return i18nString(UIStrings.subdomainRegistrationWellKnownMalformed);
926
+ case Protocol.Network.DeviceBoundSessionFetchResult.SessionProviderWellKnownUnavailable:
927
+ return i18nString(UIStrings.sessionProviderWellKnownUnavailable);
928
+ case Protocol.Network.DeviceBoundSessionFetchResult.RelyingPartyWellKnownUnavailable:
929
+ return i18nString(UIStrings.relyingPartyWellKnownUnavailable);
930
+ case Protocol.Network.DeviceBoundSessionFetchResult.FederatedKeyThumbprintMismatch:
931
+ return i18nString(UIStrings.federatedKeyThumbprintMismatch);
932
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidFederatedSessionUrl:
933
+ return i18nString(UIStrings.invalidFederatedSessionUrl);
934
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidFederatedKey:
935
+ return i18nString(UIStrings.invalidFederatedKey);
936
+ case Protocol.Network.DeviceBoundSessionFetchResult.TooManyRelyingOriginLabels:
937
+ return i18nString(UIStrings.tooManyRelyingOriginLabels);
938
+ case Protocol.Network.DeviceBoundSessionFetchResult.BoundCookieSetForbidden:
939
+ return i18nString(UIStrings.boundCookieSetForbidden);
940
+ case Protocol.Network.DeviceBoundSessionFetchResult.NetError:
941
+ return i18nString(UIStrings.netError);
942
+ case Protocol.Network.DeviceBoundSessionFetchResult.ProxyError:
943
+ return i18nString(UIStrings.proxyError);
944
+ case Protocol.Network.DeviceBoundSessionFetchResult.EmptySessionConfig:
945
+ return i18nString(UIStrings.emptySessionConfig);
946
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsConfig:
947
+ return i18nString(UIStrings.invalidCredentialsConfig);
948
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsType:
949
+ return i18nString(UIStrings.invalidCredentialsType);
950
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsEmptyName:
951
+ return i18nString(UIStrings.invalidCredentialsEmptyName);
952
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsCookie:
953
+ return i18nString(UIStrings.invalidCredentialsCookie);
954
+ case Protocol.Network.DeviceBoundSessionFetchResult.PersistentHttpError:
955
+ return i18nString(UIStrings.persistentHttpError);
956
+ case Protocol.Network.DeviceBoundSessionFetchResult.RegistrationAttemptedChallenge:
957
+ return i18nString(UIStrings.registrationAttemptedChallenge);
958
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidScopeOrigin:
959
+ return i18nString(UIStrings.invalidScopeOrigin);
960
+ case Protocol.Network.DeviceBoundSessionFetchResult.ScopeOriginContainsPath:
961
+ return i18nString(UIStrings.scopeOriginContainsPath);
962
+ case Protocol.Network.DeviceBoundSessionFetchResult.RefreshInitiatorNotString:
963
+ return i18nString(UIStrings.refreshInitiatorNotString);
964
+ case Protocol.Network.DeviceBoundSessionFetchResult.RefreshInitiatorInvalidHostPattern:
965
+ return i18nString(UIStrings.refreshInitiatorInvalidHostPattern);
966
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidScopeSpecification:
967
+ return i18nString(UIStrings.invalidScopeSpecification);
968
+ case Protocol.Network.DeviceBoundSessionFetchResult.MissingScopeSpecificationType:
969
+ return i18nString(UIStrings.missingScopeSpecificationType);
970
+ case Protocol.Network.DeviceBoundSessionFetchResult.EmptyScopeSpecificationDomain:
971
+ return i18nString(UIStrings.emptyScopeSpecificationDomain);
972
+ case Protocol.Network.DeviceBoundSessionFetchResult.EmptyScopeSpecificationPath:
973
+ return i18nString(UIStrings.emptyScopeSpecificationPath);
974
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidScopeSpecificationType:
975
+ return i18nString(UIStrings.invalidScopeSpecificationType);
976
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidScopeIncludeSite:
977
+ return i18nString(UIStrings.invalidScopeIncludeSite);
978
+ case Protocol.Network.DeviceBoundSessionFetchResult.MissingScopeIncludeSite:
979
+ return i18nString(UIStrings.missingScopeIncludeSite);
980
+ case Protocol.Network.DeviceBoundSessionFetchResult.FederatedNotAuthorizedByProvider:
981
+ return i18nString(UIStrings.federatedNotAuthorizedByProvider);
982
+ case Protocol.Network.DeviceBoundSessionFetchResult.FederatedNotAuthorizedByRelyingParty:
983
+ return i18nString(UIStrings.federatedNotAuthorizedByRelyingParty);
984
+ case Protocol.Network.DeviceBoundSessionFetchResult.SessionProviderWellKnownMalformed:
985
+ return i18nString(UIStrings.sessionProviderWellKnownMalformed);
986
+ case Protocol.Network.DeviceBoundSessionFetchResult.SessionProviderWellKnownHasProviderOrigin:
987
+ return i18nString(UIStrings.sessionProviderWellKnownHasProviderOrigin);
988
+ case Protocol.Network.DeviceBoundSessionFetchResult.RelyingPartyWellKnownMalformed:
989
+ return i18nString(UIStrings.relyingPartyWellKnownMalformed);
990
+ case Protocol.Network.DeviceBoundSessionFetchResult.RelyingPartyWellKnownHasRelyingOrigins:
991
+ return i18nString(UIStrings.relyingPartyWellKnownHasRelyingOrigins);
992
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidFederatedSessionProviderSessionMissing:
993
+ return i18nString(UIStrings.invalidFederatedSessionProviderSessionMissing);
994
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidFederatedSessionWrongProviderOrigin:
995
+ return i18nString(UIStrings.invalidFederatedSessionWrongProviderOrigin);
996
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsCookieCreationTime:
997
+ return i18nString(UIStrings.invalidCredentialsCookieCreationTime);
998
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsCookieName:
999
+ return i18nString(UIStrings.invalidCredentialsCookieName);
1000
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsCookieParsing:
1001
+ return i18nString(UIStrings.invalidCredentialsCookieParsing);
1002
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsCookieUnpermittedAttribute:
1003
+ return i18nString(UIStrings.invalidCredentialsCookieUnpermittedAttribute);
1004
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsCookieInvalidDomain:
1005
+ return i18nString(UIStrings.invalidCredentialsCookieInvalidDomain);
1006
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidCredentialsCookiePrefix:
1007
+ return i18nString(UIStrings.invalidCredentialsCookiePrefix);
1008
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidScopeRulePath:
1009
+ return i18nString(UIStrings.invalidScopeRulePath);
1010
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidScopeRuleHostPattern:
1011
+ return i18nString(UIStrings.invalidScopeRuleHostPattern);
1012
+ case Protocol.Network.DeviceBoundSessionFetchResult.ScopeRuleOriginScopedHostPatternMismatch:
1013
+ return i18nString(UIStrings.scopeRuleOriginScopedHostPatternMismatch);
1014
+ case Protocol.Network.DeviceBoundSessionFetchResult.ScopeRuleSiteScopedHostPatternMismatch:
1015
+ return i18nString(UIStrings.scopeRuleSiteScopedHostPatternMismatch);
1016
+ case Protocol.Network.DeviceBoundSessionFetchResult.SigningQuotaExceeded:
1017
+ return i18nString(UIStrings.signingQuotaExceeded);
1018
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidConfigJson:
1019
+ return i18nString(UIStrings.invalidConfigJson);
1020
+ case Protocol.Network.DeviceBoundSessionFetchResult.InvalidFederatedSessionProviderFailedToRestoreKey:
1021
+ return i18nString(UIStrings.invalidFederatedSessionProviderFailedToRestoreKey);
1022
+ case Protocol.Network.DeviceBoundSessionFetchResult.FailedToUnwrapKey:
1023
+ return i18nString(UIStrings.failedToUnwrapKey);
1024
+ case Protocol.Network.DeviceBoundSessionFetchResult.SessionDeletedDuringRefresh:
1025
+ return i18nString(UIStrings.sessionDeletedDuringRefresh);
1026
+ default:
1027
+ return fetchResult;
1028
+ }
1029
+ }
1030
+
1031
+ function refreshResultToString(refreshResult: Protocol.Network.RefreshEventDetailsRefreshResult): string {
1032
+ switch (refreshResult) {
1033
+ case Protocol.Network.RefreshEventDetailsRefreshResult.Refreshed:
1034
+ return i18nString(UIStrings.refreshed);
1035
+ case Protocol.Network.RefreshEventDetailsRefreshResult.InitializedService:
1036
+ return i18nString(UIStrings.initializedService);
1037
+ case Protocol.Network.RefreshEventDetailsRefreshResult.Unreachable:
1038
+ return i18nString(UIStrings.unreachable);
1039
+ case Protocol.Network.RefreshEventDetailsRefreshResult.ServerError:
1040
+ return i18nString(UIStrings.serverError);
1041
+ case Protocol.Network.RefreshEventDetailsRefreshResult.RefreshQuotaExceeded:
1042
+ return i18nString(UIStrings.refreshQuotaExceeded);
1043
+ case Protocol.Network.RefreshEventDetailsRefreshResult.FatalError:
1044
+ return i18nString(UIStrings.fatalError);
1045
+ case Protocol.Network.RefreshEventDetailsRefreshResult.SigningQuotaExceeded:
1046
+ return i18nString(UIStrings.signingQuotaExceeded);
1047
+ default:
1048
+ return refreshResult;
1049
+ }
1050
+ }
1051
+
1052
+ function challengeResultToString(challengeResult: Protocol.Network.ChallengeEventDetailsChallengeResult): string {
1053
+ switch (challengeResult) {
1054
+ case Protocol.Network.ChallengeEventDetailsChallengeResult.Success:
1055
+ return i18nString(UIStrings.success);
1056
+ case Protocol.Network.ChallengeEventDetailsChallengeResult.NoSessionId:
1057
+ return i18nString(UIStrings.noSessionId);
1058
+ case Protocol.Network.ChallengeEventDetailsChallengeResult.NoSessionMatch:
1059
+ return i18nString(UIStrings.noSessionMatch);
1060
+ case Protocol.Network.ChallengeEventDetailsChallengeResult.CantSetBoundCookie:
1061
+ return i18nString(UIStrings.cantSetBoundCookie);
1062
+ default:
1063
+ return challengeResult;
1064
+ }
1065
+ }
1066
+
1067
+ function deletionReasonToString(deletionReason: Protocol.Network.TerminationEventDetailsDeletionReason): string {
1068
+ switch (deletionReason) {
1069
+ case Protocol.Network.TerminationEventDetailsDeletionReason.Expired:
1070
+ return i18nString(UIStrings.expired);
1071
+ case Protocol.Network.TerminationEventDetailsDeletionReason.FailedToRestoreKey:
1072
+ return i18nString(UIStrings.failedToRestoreKey);
1073
+ case Protocol.Network.TerminationEventDetailsDeletionReason.FailedToUnwrapKey:
1074
+ return i18nString(UIStrings.failedToUnwrapKey);
1075
+ case Protocol.Network.TerminationEventDetailsDeletionReason.StoragePartitionCleared:
1076
+ return i18nString(UIStrings.storagePartitionCleared);
1077
+ case Protocol.Network.TerminationEventDetailsDeletionReason.ClearBrowsingData:
1078
+ return i18nString(UIStrings.clearBrowsingData);
1079
+ case Protocol.Network.TerminationEventDetailsDeletionReason.ServerRequested:
1080
+ return i18nString(UIStrings.serverRequestedTermination);
1081
+ case Protocol.Network.TerminationEventDetailsDeletionReason.InvalidSessionParams:
1082
+ return i18nString(UIStrings.invalidSessionParams);
1083
+ case Protocol.Network.TerminationEventDetailsDeletionReason.RefreshFatalError:
1084
+ return i18nString(UIStrings.refreshFatalError);
1085
+ default:
1086
+ return deletionReason;
1087
+ }
1088
+ }
1089
+
1090
+ function boolToString(bool: boolean): string {
1091
+ return bool ? i18nString(UIStrings.yes) : i18nString(UIStrings.no);
1092
+ }
1093
+
1094
+ function succeededToString(succeeded: boolean): string {
1095
+ return succeeded ? i18nString(UIStrings.success) : i18nString(UIStrings.error);
252
1096
  }