chrome-devtools-frontend 1.0.1542501 → 1.0.1543472
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.
- package/AUTHORS +1 -0
- package/front_end/core/common/Gzip.ts +4 -4
- package/front_end/core/common/common.ts +0 -2
- package/front_end/core/host/InspectorFrontendHost.ts +0 -3
- package/front_end/core/root/DevToolsContext.ts +60 -0
- package/front_end/core/root/Runtime.ts +0 -10
- package/front_end/core/root/root.ts +6 -1
- package/front_end/core/sdk/NetworkManager.ts +0 -7
- package/front_end/core/sdk/NetworkRequest.ts +0 -10
- package/front_end/core/sdk/TargetManager.ts +5 -6
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +1 -13
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +5 -5
- package/front_end/entrypoints/main/MainImpl.ts +3 -5
- package/front_end/entrypoints/main/main-meta.ts +1 -5
- package/front_end/foundation/Universe.ts +13 -1
- package/front_end/generated/Deprecation.ts +0 -14
- package/front_end/generated/InspectorBackendCommands.ts +1 -1
- package/front_end/generated/protocol.ts +0 -1
- package/front_end/models/ai_assistance/BuiltInAi.ts +13 -7
- package/front_end/models/bindings/CompilerScriptMapping.ts +3 -2
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +14 -9
- package/front_end/models/trace/handlers/SamplesHandler.ts +64 -6
- package/front_end/models/trace/types/TraceEvents.ts +16 -0
- package/front_end/models/workspace/IgnoreListManager.ts +10 -9
- package/front_end/models/workspace/WorkspaceImpl.ts +5 -10
- package/front_end/panels/application/ApplicationPanelSidebar.ts +0 -1
- package/front_end/panels/application/OpenedWindowDetailsView.ts +0 -2
- package/front_end/panels/application/ServiceWorkersView.ts +0 -2
- package/front_end/panels/application/StorageView.ts +0 -1
- package/front_end/panels/application/components/BackForwardCacheView.ts +12 -9
- package/front_end/panels/application/components/FrameDetailsView.ts +468 -447
- package/front_end/panels/console/ConsolePrompt.ts +1 -1
- package/front_end/panels/console/ConsoleView.ts +12 -7
- package/front_end/panels/console/ConsoleViewMessage.ts +19 -9
- package/front_end/panels/explain/components/ConsoleInsight.ts +314 -310
- package/front_end/panels/network/NetworkDataGridNode.ts +0 -7
- package/front_end/panels/network/NetworkLogView.ts +1 -45
- package/front_end/panels/security/SecurityPanel.ts +0 -2
- package/front_end/panels/security/SecurityPanelSidebar.ts +0 -16
- package/front_end/panels/security/security.ts +0 -2
- package/front_end/panels/settings/SettingsScreen.ts +3 -6
- package/front_end/panels/settings/components/SyncSection.ts +218 -226
- package/front_end/panels/settings/components/syncSection.css +81 -80
- package/front_end/panels/sources/DebuggerPlugin.ts +3 -1
- package/front_end/panels/sources/ResourceOriginPlugin.ts +7 -3
- package/front_end/panels/timeline/TimelinePanel.ts +0 -21
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/components/docs/component_docs.ts +0 -4
- package/front_end/ui/components/expandable_list/ExpandableList.docs.ts +30 -0
- package/front_end/ui/components/report_view/ReportView.ts +4 -1
- package/front_end/ui/legacy/ReportView.ts +0 -5
- package/front_end/ui/legacy/TextPrompt.ts +65 -19
- package/front_end/ui/legacy/components/object_ui/JavaScriptREPL.ts +8 -4
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +90 -92
- package/front_end/ui/legacy/components/object_ui/RemoteObjectPreviewFormatter.ts +114 -184
- package/front_end/ui/legacy/components/utils/Linkifier.ts +46 -2
- package/front_end/ui/{components/docs/theme_colors/basic.ts → legacy/theme_support/ThemeColors.docs.ts} +33 -23
- package/package.json +1 -1
- package/front_end/core/common/QueryParamHandler.ts +0 -7
- package/front_end/panels/security/IPProtectionTreeElement.ts +0 -21
- package/front_end/panels/security/IPProtectionView.ts +0 -287
- package/front_end/ui/components/docs/expandable_list/basic.html +0 -24
- package/front_end/ui/components/docs/expandable_list/basic.ts +0 -30
- package/front_end/ui/components/docs/input/basic.html +0 -31
- package/front_end/ui/components/docs/input/basic.ts +0 -12
- package/front_end/ui/components/docs/report/basic.html +0 -27
- package/front_end/ui/components/docs/report/basic.ts +0 -48
- package/front_end/ui/components/docs/text_prompt/basic.html +0 -35
- package/front_end/ui/components/docs/text_prompt/basic.ts +0 -19
- package/front_end/ui/components/docs/theme_colors/basic.html +0 -56
- package/front_end/ui/components/docs/toggle_dark_mode.ts +0 -36
- package/front_end/ui/components/docs/toggle_fonts.ts +0 -74
- package/front_end/ui/components/docs/user_agent_client_hints/basic.html +0 -25
- package/front_end/ui/components/docs/user_agent_client_hints/basic.ts +0 -26
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
// Copyright 2025 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import '../../ui/components/switch/switch.js';
|
|
6
|
-
import '../../ui/components/cards/cards.js';
|
|
7
|
-
import '../../ui/legacy/components/data_grid/data_grid.js';
|
|
8
|
-
import '../../ui/components/buttons/buttons.js';
|
|
9
|
-
|
|
10
|
-
import * as i18n from '../../core/i18n/i18n.js';
|
|
11
|
-
import type * as Platform from '../../core/platform/platform.js';
|
|
12
|
-
import * as Root from '../../core/root/root.js';
|
|
13
|
-
import * as SDK from '../../core/sdk/sdk.js';
|
|
14
|
-
import * as Protocol from '../../generated/protocol.js';
|
|
15
|
-
import * as UI from '../../ui/legacy/legacy.js';
|
|
16
|
-
import * as Lit from '../../ui/lit/lit.js';
|
|
17
|
-
|
|
18
|
-
import ipProtectionViewStyles from './ipProtectionView.css.js';
|
|
19
|
-
|
|
20
|
-
const {render, html} = Lit;
|
|
21
|
-
const {widgetConfig} = UI.Widget;
|
|
22
|
-
|
|
23
|
-
const UIStrings = {
|
|
24
|
-
/**
|
|
25
|
-
*@description Title in the view's header for the IP Protection tool in the Privacy & Security panel
|
|
26
|
-
*/
|
|
27
|
-
viewTitle: 'IP Protection Proxy Controls',
|
|
28
|
-
/**
|
|
29
|
-
*@description Explanation in the view's header about the purpose of this IP Protection tool
|
|
30
|
-
*/
|
|
31
|
-
viewExplanation: 'Test how this site will perform if IP Proxy is enabled in Chrome',
|
|
32
|
-
/**
|
|
33
|
-
*@description Title in the card within the IP Protection tool
|
|
34
|
-
*/
|
|
35
|
-
cardTitle: 'IP Protection Proxy Status',
|
|
36
|
-
/**
|
|
37
|
-
*@description Subheading for bypassing IP protection toggle
|
|
38
|
-
*/
|
|
39
|
-
bypassTitle: 'Bypass IP Protection',
|
|
40
|
-
/**
|
|
41
|
-
*@description Description of bypass IP protection toggle
|
|
42
|
-
*/
|
|
43
|
-
bypassDescription: 'Temporarily bypass IP protection for testing',
|
|
44
|
-
/**
|
|
45
|
-
* @description Text informing the user that IP Proxy is not available
|
|
46
|
-
*/
|
|
47
|
-
notInIncognito: 'IP proxy unavailable',
|
|
48
|
-
/**
|
|
49
|
-
* @description Description in the widget instructing users to open site in incognito
|
|
50
|
-
*/
|
|
51
|
-
openIncognito: 'IP proxy is only available within incognito mode. Open site in incognito.',
|
|
52
|
-
/**
|
|
53
|
-
* @description Column header for the ID of a proxy request in the Proxy Request View panel.
|
|
54
|
-
*/
|
|
55
|
-
idColumn: 'ID',
|
|
56
|
-
/**
|
|
57
|
-
* @description Column header for the URL of a proxy request in the Proxy Request View panel.
|
|
58
|
-
*/
|
|
59
|
-
urlColumn: 'URL',
|
|
60
|
-
/**
|
|
61
|
-
* @description Column header for the HTTP method of a proxy request in the Proxy Request View panel.
|
|
62
|
-
*/
|
|
63
|
-
methodColumn: 'Method',
|
|
64
|
-
/**
|
|
65
|
-
* @description Column header for the status code of a proxy request in the Proxy Request View panel.
|
|
66
|
-
*/
|
|
67
|
-
statusColumn: 'Status',
|
|
68
|
-
/**
|
|
69
|
-
* @description Title for the grid of proxy requests.
|
|
70
|
-
*/
|
|
71
|
-
proxyRequests: 'Proxy Requests',
|
|
72
|
-
/**
|
|
73
|
-
* @description The status text for the available status of the IP protection proxy.
|
|
74
|
-
*/
|
|
75
|
-
Available: 'IP Protection is enabled and active.',
|
|
76
|
-
/**
|
|
77
|
-
* @description The status text for when the feature is not enabled.
|
|
78
|
-
*/
|
|
79
|
-
FeatureNotEnabled: 'IP Protection feature is not enabled.',
|
|
80
|
-
/**
|
|
81
|
-
* @description The status text for when the masked domain list is not enabled.
|
|
82
|
-
*/
|
|
83
|
-
MaskedDomainListNotEnabled: 'Masked Domain List feature is not enabled.',
|
|
84
|
-
/**
|
|
85
|
-
* @description The status text for when the masked domain list is not populated.
|
|
86
|
-
*/
|
|
87
|
-
MaskedDomainListNotPopulated: 'Masked Domain List is not populated.',
|
|
88
|
-
/**
|
|
89
|
-
* @description The status text for when authentication tokens are unavailable.
|
|
90
|
-
*/
|
|
91
|
-
AuthTokensUnavailable: 'Limit for authentication tokens was reached. IP Protection will be paused.',
|
|
92
|
-
/**
|
|
93
|
-
* @description The status text for when the proxy is unavailable for another reason.
|
|
94
|
-
*/
|
|
95
|
-
Unavailable: 'IP Protection is unavailable.',
|
|
96
|
-
/**
|
|
97
|
-
* @description The status text for when the proxy is bypassed by DevTools.
|
|
98
|
-
*/
|
|
99
|
-
BypassedByDevTools: 'IP Protection is being bypassed by DevTools.',
|
|
100
|
-
/**
|
|
101
|
-
* @description The status text for when the status is unknown or being loaded.
|
|
102
|
-
*/
|
|
103
|
-
statusUnknown: 'Status unknown',
|
|
104
|
-
} as const;
|
|
105
|
-
|
|
106
|
-
const str_ = i18n.i18n.registerUIStrings('panels/security/IPProtectionView.ts', UIStrings);
|
|
107
|
-
export const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
108
|
-
|
|
109
|
-
// Explicitly reference dynamically referenced UIStrings to prevent the linter from removing
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
111
|
-
const allStatusStrings = [
|
|
112
|
-
UIStrings.Available,
|
|
113
|
-
UIStrings.FeatureNotEnabled,
|
|
114
|
-
UIStrings.MaskedDomainListNotEnabled,
|
|
115
|
-
UIStrings.MaskedDomainListNotPopulated,
|
|
116
|
-
UIStrings.AuthTokensUnavailable,
|
|
117
|
-
UIStrings.Unavailable,
|
|
118
|
-
UIStrings.BypassedByDevTools,
|
|
119
|
-
UIStrings.statusUnknown,
|
|
120
|
-
];
|
|
121
|
-
const INCOGNITO_EXPLANATION_URL = 'https://support.google.com/chrome/answer/95464?hl=en&co=GENIE.Platform%3DDesktop' as
|
|
122
|
-
Platform.DevToolsPath.UrlString;
|
|
123
|
-
|
|
124
|
-
/** A simplified representation of a network request for mock data. **/
|
|
125
|
-
interface MockNetworkRequest {
|
|
126
|
-
requestId: string;
|
|
127
|
-
url: string;
|
|
128
|
-
requestMethod: string;
|
|
129
|
-
statusCode: number;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export interface ViewInput {
|
|
133
|
-
status: Protocol.Network.IpProxyStatus|null;
|
|
134
|
-
proxyRequests: readonly MockNetworkRequest[];
|
|
135
|
-
}
|
|
136
|
-
export type View = (input: ViewInput, output: object, target: HTMLElement) => void;
|
|
137
|
-
|
|
138
|
-
export const DEFAULT_VIEW: View = (input, _output, target) => {
|
|
139
|
-
const {status} = input;
|
|
140
|
-
const statusText = status ? i18nString(UIStrings[status]) : i18nString(UIStrings.statusUnknown);
|
|
141
|
-
|
|
142
|
-
// clang-format off
|
|
143
|
-
const cardHeader = html`
|
|
144
|
-
<div class="card-header">
|
|
145
|
-
<div class="lhs">
|
|
146
|
-
<div class="text">
|
|
147
|
-
<h2 class="main-text">${i18nString(UIStrings.cardTitle)}</h2>
|
|
148
|
-
<div class="body subtext">${statusText}</div>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
<div class="status-badge">
|
|
152
|
-
${
|
|
153
|
-
status === Protocol.Network.IpProxyStatus.Available ?
|
|
154
|
-
html`<devtools-icon class="status-icon green-status-icon" role="presentation" name="check-circle"></devtools-icon>` :
|
|
155
|
-
html`<devtools-icon class="status-icon red-status-icon" role="presentation" name="cross-circle-filled"></devtools-icon>`}
|
|
156
|
-
</div>
|
|
157
|
-
</div>
|
|
158
|
-
`;
|
|
159
|
-
render(
|
|
160
|
-
html`
|
|
161
|
-
<style>
|
|
162
|
-
${ipProtectionViewStyles}
|
|
163
|
-
</style>
|
|
164
|
-
${
|
|
165
|
-
Root.Runtime.hostConfig.isOffTheRecord ? html`
|
|
166
|
-
<div class="overflow-auto">
|
|
167
|
-
<div class="ip-protection">
|
|
168
|
-
<div class="header">
|
|
169
|
-
<h1>${i18nString(UIStrings.viewTitle)}</h1>
|
|
170
|
-
<div class="body">${i18nString(UIStrings.viewExplanation)}</div>
|
|
171
|
-
</div>
|
|
172
|
-
<devtools-card class="card-container">
|
|
173
|
-
<div class="card">
|
|
174
|
-
${cardHeader}
|
|
175
|
-
<div>
|
|
176
|
-
<div class="card-row">
|
|
177
|
-
<div class="lhs">
|
|
178
|
-
<h3 class="main-text">${i18nString(UIStrings.bypassTitle)}</h3>
|
|
179
|
-
<div class="body subtext">${i18nString(UIStrings.bypassDescription)}</div>
|
|
180
|
-
</div>
|
|
181
|
-
<div>
|
|
182
|
-
<devtools-switch></devtools-switch>
|
|
183
|
-
</div>
|
|
184
|
-
</div>
|
|
185
|
-
</div>
|
|
186
|
-
</div>
|
|
187
|
-
</devtools-card>
|
|
188
|
-
<devtools-data-grid striped name=${i18nString(UIStrings.proxyRequests)}>
|
|
189
|
-
<table>
|
|
190
|
-
<thead>
|
|
191
|
-
<tr>
|
|
192
|
-
<th id="id" sortable>${i18nString(UIStrings.idColumn)}</th>
|
|
193
|
-
<th id="url" sortable>${i18nString(UIStrings.urlColumn)}</th>
|
|
194
|
-
<th id="method" sortable>${i18nString(UIStrings.methodColumn)}</th>
|
|
195
|
-
<th id="status" sortable>${i18nString(UIStrings.statusColumn)}</th>
|
|
196
|
-
</tr>
|
|
197
|
-
</thead>
|
|
198
|
-
<tbody id="proxy-requests-body">
|
|
199
|
-
${input.proxyRequests.map((request, index) => html`
|
|
200
|
-
<tr data-request-id=${request.requestId}>
|
|
201
|
-
<td>${index + 1}</td>
|
|
202
|
-
<td>${request.url}</td>
|
|
203
|
-
<td>${request.requestMethod}</td>
|
|
204
|
-
<td>${String(request.statusCode)}</td>
|
|
205
|
-
</tr>
|
|
206
|
-
`)}
|
|
207
|
-
</tbody>
|
|
208
|
-
</table>
|
|
209
|
-
</devtools-data-grid>
|
|
210
|
-
</div>
|
|
211
|
-
</div>
|
|
212
|
-
` :
|
|
213
|
-
html`
|
|
214
|
-
<div class="empty-report">
|
|
215
|
-
<devtools-widget
|
|
216
|
-
class="learn-more"
|
|
217
|
-
.widgetConfig=${widgetConfig(UI.EmptyWidget.EmptyWidget, {
|
|
218
|
-
header: i18nString(UIStrings.notInIncognito),
|
|
219
|
-
text: i18nString(UIStrings.openIncognito),
|
|
220
|
-
link: INCOGNITO_EXPLANATION_URL,
|
|
221
|
-
})}>
|
|
222
|
-
</devtools-widget>
|
|
223
|
-
</div>
|
|
224
|
-
`}
|
|
225
|
-
`,
|
|
226
|
-
target);
|
|
227
|
-
// clang-format on
|
|
228
|
-
};
|
|
229
|
-
export class IPProtectionView extends UI.Widget.VBox {
|
|
230
|
-
#view: View;
|
|
231
|
-
#proxyRequests: MockNetworkRequest[] = [];
|
|
232
|
-
#status: Protocol.Network.IpProxyStatus|null = null;
|
|
233
|
-
|
|
234
|
-
constructor(element?: HTMLElement, view: View = DEFAULT_VIEW) {
|
|
235
|
-
super(element, {useShadowDom: true});
|
|
236
|
-
this.#view = view;
|
|
237
|
-
|
|
238
|
-
// TODO(crbug.com/429153435): Replace with real data.
|
|
239
|
-
this.#proxyRequests = [
|
|
240
|
-
{requestId: '1', url: 'https://example.com/api/data', requestMethod: 'GET', statusCode: 200},
|
|
241
|
-
{requestId: '2', url: 'https://example.com/api/submit', requestMethod: 'POST', statusCode: 404},
|
|
242
|
-
{requestId: '3', url: 'https://example.com/assets/style.css', requestMethod: 'GET', statusCode: 200},
|
|
243
|
-
];
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
override async wasShown(): Promise<void> {
|
|
247
|
-
super.wasShown();
|
|
248
|
-
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
249
|
-
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.PrimaryPageChanged,
|
|
250
|
-
this.#updateIpProtectionStatus, this);
|
|
251
|
-
await this.#updateIpProtectionStatus();
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
override willHide(): void {
|
|
255
|
-
SDK.TargetManager.TargetManager.instance().removeModelListener(
|
|
256
|
-
SDK.ResourceTreeModel.ResourceTreeModel, SDK.ResourceTreeModel.Events.PrimaryPageChanged,
|
|
257
|
-
this.#updateIpProtectionStatus, this);
|
|
258
|
-
super.willHide();
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
async #updateIpProtectionStatus(): Promise<void> {
|
|
262
|
-
const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
263
|
-
if (!target) {
|
|
264
|
-
this.#status = null;
|
|
265
|
-
this.requestUpdate();
|
|
266
|
-
return;
|
|
267
|
-
}
|
|
268
|
-
const model = target.model(SDK.NetworkManager.NetworkManager);
|
|
269
|
-
if (!model) {
|
|
270
|
-
this.#status = null;
|
|
271
|
-
this.requestUpdate();
|
|
272
|
-
return;
|
|
273
|
-
}
|
|
274
|
-
const status = await model.getIpProtectionProxyStatus();
|
|
275
|
-
this.#status = status;
|
|
276
|
-
this.requestUpdate();
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
get proxyRequests(): readonly MockNetworkRequest[] {
|
|
280
|
-
return this.#proxyRequests;
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
override performUpdate(): void {
|
|
284
|
-
const input = {status: this.#status, proxyRequests: this.#proxyRequests};
|
|
285
|
-
this.#view(input, this, this.contentElement);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2021 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>Basic Expandable List example</title>
|
|
12
|
-
<style>
|
|
13
|
-
#container {
|
|
14
|
-
padding: 20px;
|
|
15
|
-
font-size: 16px;
|
|
16
|
-
}
|
|
17
|
-
</style>
|
|
18
|
-
</head>
|
|
19
|
-
<body>
|
|
20
|
-
<div id="container">
|
|
21
|
-
</div>
|
|
22
|
-
<script type="module" src="./basic.js"></script>
|
|
23
|
-
</body>
|
|
24
|
-
</html>
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// Copyright 2021 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
6
|
-
import * as Lit from '../../../lit/lit.js';
|
|
7
|
-
import * as ExpandableList from '../../expandable_list/expandable_list.js';
|
|
8
|
-
|
|
9
|
-
const {html} = Lit;
|
|
10
|
-
|
|
11
|
-
await FrontendHelpers.initializeGlobalVars();
|
|
12
|
-
|
|
13
|
-
const component = new ExpandableList.ExpandableList.ExpandableList();
|
|
14
|
-
|
|
15
|
-
const rows = [];
|
|
16
|
-
rows.push(html`
|
|
17
|
-
<div>This is row 1. Click on the triangle icon to expand.</div>
|
|
18
|
-
`);
|
|
19
|
-
|
|
20
|
-
for (let rowNumber = 2; rowNumber < 11; rowNumber++) {
|
|
21
|
-
rows.push(html`
|
|
22
|
-
<div>This is row ${rowNumber}.</div>
|
|
23
|
-
`);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
component.data = {
|
|
27
|
-
rows,
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
document.getElementById('container')?.appendChild(component);
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2021 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>Input example</title>
|
|
12
|
-
<style>
|
|
13
|
-
#container {
|
|
14
|
-
padding: 25px;
|
|
15
|
-
width: 300px;
|
|
16
|
-
display: flex;
|
|
17
|
-
flex-direction: column;
|
|
18
|
-
font-size: 16px;
|
|
19
|
-
}
|
|
20
|
-
#container > * {
|
|
21
|
-
margin-bottom: 10px;
|
|
22
|
-
}
|
|
23
|
-
</style>
|
|
24
|
-
</head>
|
|
25
|
-
<body>
|
|
26
|
-
<div id="container">
|
|
27
|
-
<input class="devtools-text-input" placeholder="placeholder" />
|
|
28
|
-
</div>
|
|
29
|
-
<script type="module" src="./basic.js"></script>
|
|
30
|
-
</body>
|
|
31
|
-
</html>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Copyright 2021 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
6
|
-
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
7
|
-
import * as Input from '../../input/input.js';
|
|
8
|
-
|
|
9
|
-
await ComponentHelpers.ComponentServerSetup.setup();
|
|
10
|
-
await FrontendHelpers.initializeGlobalVars();
|
|
11
|
-
|
|
12
|
-
document.head.appendChild(document.createElement('style')).textContent = Input.textInputStyles;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2020 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
<head>
|
|
9
|
-
<meta charset="UTF-8" />
|
|
10
|
-
<meta name="viewport" content="width=device-width" />
|
|
11
|
-
<title>Basic IssueLinkIcon example</title>
|
|
12
|
-
<style>
|
|
13
|
-
#container {
|
|
14
|
-
width: 80%;
|
|
15
|
-
border: 1px solid black;
|
|
16
|
-
height: 300px;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
</style>
|
|
20
|
-
</head>
|
|
21
|
-
<body>
|
|
22
|
-
<div id="container">
|
|
23
|
-
</div>
|
|
24
|
-
|
|
25
|
-
<script type="module" src="./basic.js"></script>
|
|
26
|
-
</body>
|
|
27
|
-
</html>
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import '../../report_view/report_view.js';
|
|
6
|
-
|
|
7
|
-
import * as Lit from '../../../lit/lit.js';
|
|
8
|
-
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
9
|
-
|
|
10
|
-
const {html} = Lit;
|
|
11
|
-
|
|
12
|
-
await ComponentHelpers.ComponentServerSetup.setup();
|
|
13
|
-
|
|
14
|
-
const exampleRenderHelper = (key: string, value: string) => html`
|
|
15
|
-
<devtools-report-key>${key}</devtools-report-key>
|
|
16
|
-
<devtools-report-value>${value}</devtools-report-value>
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
const container = document.querySelector<HTMLElement>('#container');
|
|
20
|
-
if (!container) {
|
|
21
|
-
throw new Error('Could not find container');
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
Lit.render(
|
|
25
|
-
html`
|
|
26
|
-
<style>
|
|
27
|
-
.source-code {
|
|
28
|
-
font-family: monospace;
|
|
29
|
-
}
|
|
30
|
-
</style>
|
|
31
|
-
|
|
32
|
-
<devtools-report .data=${{
|
|
33
|
-
reportTitle:
|
|
34
|
-
'Optional Title',
|
|
35
|
-
}}>
|
|
36
|
-
<devtools-report-section-header>Section 1</devtools-report-section-header>
|
|
37
|
-
<devtools-report-key>Basic plain text field</devtools-report-key>
|
|
38
|
-
<devtools-report-value>And this is the value</devtools-report-value>
|
|
39
|
-
<devtools-report-key>A field with a code value</devtools-report-key>
|
|
40
|
-
<devtools-report-value class="source-code">SomeCodeValue</devtools-report-value>
|
|
41
|
-
<devtools-report-divider></devtools-report-divider>
|
|
42
|
-
<devtools-report-section-header>Section 2</devtools-report-section-header>
|
|
43
|
-
${exampleRenderHelper('Using a small helper', 'to render report rows')}
|
|
44
|
-
${exampleRenderHelper('This wide column defines the column width', 'for all rows')}
|
|
45
|
-
<devtools-report-divider></devtools-report-divider>
|
|
46
|
-
</devtools-report>
|
|
47
|
-
`,
|
|
48
|
-
container);
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2021 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
|
|
9
|
-
<head>
|
|
10
|
-
<meta charset="UTF-8" />
|
|
11
|
-
<meta name="viewport" content="width=device-width" />
|
|
12
|
-
<title>Basic Text Prompt example</title>
|
|
13
|
-
<meta charset="UTF-8" />
|
|
14
|
-
<style>
|
|
15
|
-
#container {
|
|
16
|
-
width: 80%;
|
|
17
|
-
border: 1px solid black;
|
|
18
|
-
padding: 20px;
|
|
19
|
-
height: 300px;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
#container > devtools-text-prompt {
|
|
23
|
-
vertical-align: middle;
|
|
24
|
-
font-size: 14px;
|
|
25
|
-
border: 1px solid #ccc;
|
|
26
|
-
}
|
|
27
|
-
</style>
|
|
28
|
-
</head>
|
|
29
|
-
|
|
30
|
-
<body>
|
|
31
|
-
<div id="container"></div>
|
|
32
|
-
<script type="module" src="./basic.js"></script>
|
|
33
|
-
</body>
|
|
34
|
-
|
|
35
|
-
</html>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// Copyright 2021 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
import * as FrontendHelpers from '../../../../testing/EnvironmentHelpers.js';
|
|
6
|
-
import * as ComponentHelpers from '../../helpers/helpers.js';
|
|
7
|
-
import * as TextPrompt from '../../text_prompt/text_prompt.js';
|
|
8
|
-
|
|
9
|
-
await ComponentHelpers.ComponentServerSetup.setup();
|
|
10
|
-
await FrontendHelpers.initializeGlobalVars();
|
|
11
|
-
|
|
12
|
-
const textPrompt = new TextPrompt.TextPrompt.TextPrompt();
|
|
13
|
-
document.getElementById('container')?.appendChild(textPrompt);
|
|
14
|
-
|
|
15
|
-
textPrompt.data = {
|
|
16
|
-
ariaLabel: 'Quick open prompt',
|
|
17
|
-
prefix: 'Open',
|
|
18
|
-
suggestion: 'File',
|
|
19
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
Copyright 2020 The Chromium Authors
|
|
3
|
-
Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
found in the LICENSE file.
|
|
5
|
-
-->
|
|
6
|
-
<!DOCTYPE html>
|
|
7
|
-
<html>
|
|
8
|
-
|
|
9
|
-
<head>
|
|
10
|
-
<meta charset="UTF-8" />
|
|
11
|
-
<meta name="viewport" content="width=device-width" />
|
|
12
|
-
<title>DevTools Theme Colors</title>
|
|
13
|
-
<style>
|
|
14
|
-
body {
|
|
15
|
-
/**
|
|
16
|
-
* The injected themes switch off user-select. This switches
|
|
17
|
-
* it back on so that we can select colors.
|
|
18
|
-
*/
|
|
19
|
-
user-select: auto !important; /* stylelint-disable-line declaration-no-important */
|
|
20
|
-
overflow: auto !important; /* stylelint-disable-line declaration-no-important */
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
#container {
|
|
24
|
-
display: grid;
|
|
25
|
-
max-width: 600px;
|
|
26
|
-
grid-template-columns: repeat(2, 1fr);
|
|
27
|
-
row-gap: var(--sys-size-5);
|
|
28
|
-
column-gap: var(--sys-size-5);
|
|
29
|
-
|
|
30
|
-
> span {
|
|
31
|
-
font: var(--sys-typescale-headline1);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
> div {
|
|
35
|
-
display: block;
|
|
36
|
-
border-bottom-width: var(--sys-size-9);
|
|
37
|
-
border-bottom-style: solid;
|
|
38
|
-
text-align: center;
|
|
39
|
-
font: var(--sys-typescale-body1-regular);
|
|
40
|
-
margin-bottom: var(--sys-size-5);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
</style>
|
|
44
|
-
</head>
|
|
45
|
-
|
|
46
|
-
<body>
|
|
47
|
-
|
|
48
|
-
<div id="container">
|
|
49
|
-
<span>Light Mode</span>
|
|
50
|
-
<span>Dark Mode</span>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<script type="module" src="./basic.js"></script>
|
|
54
|
-
</body>
|
|
55
|
-
|
|
56
|
-
</html>
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
// Copyright 2020 The Chromium Authors
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
const DARK_THEME_CLASS = 'theme-with-dark-background';
|
|
6
|
-
|
|
7
|
-
function toggleDarkMode(force?: boolean): void {
|
|
8
|
-
// Only use the second arg if its not undefined. The spec treats `undefined` as falsy. :/
|
|
9
|
-
document.body.classList.toggle(...[DARK_THEME_CLASS, ...force !== undefined ? [force] : []]);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export function init(): void {
|
|
13
|
-
// To keep consistent test results, we don't auto-initialize darkmode. This'd do it, though:
|
|
14
|
-
// toggleDarkMode(window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
15
|
-
|
|
16
|
-
window.addEventListener('load', () => {
|
|
17
|
-
const button = document.createElement('button');
|
|
18
|
-
button.innerText = 'Toggle light/dark mode';
|
|
19
|
-
button.className = 'component-docs-ui';
|
|
20
|
-
|
|
21
|
-
button.style.position = 'fixed';
|
|
22
|
-
button.style.bottom = '10px';
|
|
23
|
-
button.style.right = '10px';
|
|
24
|
-
button.style.width = '200px';
|
|
25
|
-
button.style.fontSize = '16px';
|
|
26
|
-
button.style.padding = '5px';
|
|
27
|
-
button.style.cursor = 'pointer';
|
|
28
|
-
|
|
29
|
-
button.addEventListener('click', event => {
|
|
30
|
-
event.preventDefault();
|
|
31
|
-
toggleDarkMode();
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
document.body.appendChild(button);
|
|
35
|
-
});
|
|
36
|
-
}
|