chrome-devtools-frontend 1.0.950971 → 1.0.952403
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/config/gni/devtools_grd_files.gni +6 -3
- package/extension-api/ExtensionAPI.d.ts +1 -1
- package/front_end/.eslintrc.js +6 -0
- package/front_end/Tests.js +10 -0
- package/front_end/core/common/App.ts +0 -3
- package/front_end/core/common/AppProvider.ts +0 -3
- package/front_end/core/common/JavaScriptMetaData.ts +0 -3
- package/front_end/core/common/QueryParamHandler.ts +0 -3
- package/front_end/core/common/Runnable.ts +0 -3
- package/front_end/core/common/SimpleHistoryManager.ts +0 -3
- package/front_end/core/host/UserMetrics.ts +2 -1
- package/front_end/core/i18n/locales/en-US.json +186 -183
- package/front_end/core/i18n/locales/en-XL.json +186 -183
- package/front_end/core/root/Runtime.ts +4 -12
- package/front_end/core/sdk/CSSRule.ts +1 -1
- package/front_end/core/sdk/DOMModel.ts +12 -37
- package/front_end/core/sdk/OverlayModel.ts +18 -34
- package/front_end/core/sdk/OverlayPersistentHighlighter.ts +0 -12
- package/front_end/core/sdk/PageResourceLoader.ts +2 -1
- package/front_end/core/sdk/RuntimeModel.ts +0 -1
- package/front_end/core/sdk/SourceMap.ts +1 -1
- package/front_end/core/sdk/TracingManager.ts +0 -3
- package/front_end/entrypoints/formatter_worker/AcornTokenizer.ts +39 -39
- package/front_end/entrypoints/formatter_worker/CSSFormatter.ts +54 -54
- package/front_end/entrypoints/formatter_worker/ESTreeWalker.ts +20 -20
- package/front_end/entrypoints/formatter_worker/FormattedContentBuilder.ts +54 -54
- package/front_end/entrypoints/formatter_worker/HTMLFormatter.ts +145 -144
- package/front_end/entrypoints/formatter_worker/JavaScriptFormatter.ts +40 -40
- package/front_end/entrypoints/heap_snapshot_worker/AllocationProfile.ts +65 -70
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshot.ts +203 -204
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotLoader.ts +109 -108
- package/front_end/entrypoints/heap_snapshot_worker/HeapSnapshotWorkerDispatcher.ts +18 -18
- package/front_end/entrypoints/inspector_main/InspectorMain.ts +30 -30
- package/front_end/entrypoints/inspector_main/RenderingOptions.ts +25 -25
- package/front_end/entrypoints/main/ExecutionContextSelector.ts +52 -55
- package/front_end/entrypoints/main/MainImpl.ts +49 -49
- package/front_end/entrypoints/node_app/NodeConnectionsPanel.ts +43 -43
- package/front_end/entrypoints/node_app/NodeMain.ts +38 -38
- package/front_end/generated/InspectorBackendCommands.js +5 -1
- package/front_end/generated/protocol.d.ts +16 -0
- package/front_end/legacy/legacy-defs.d.ts +0 -21
- package/front_end/models/bindings/CSSWorkspaceBinding.ts +0 -3
- package/front_end/models/bindings/DebuggerLanguagePlugins.ts +1 -2
- package/front_end/models/bindings/DebuggerWorkspaceBinding.ts +1 -4
- package/front_end/models/bindings/FileUtils.ts +0 -4
- package/front_end/models/bindings/IgnoreListManager.ts +1 -2
- package/front_end/models/bindings/NetworkProject.ts +1 -2
- package/front_end/models/extensions/ExtensionAPI.ts +2 -2
- package/front_end/models/extensions/ExtensionTraceProvider.ts +0 -3
- package/front_end/models/heap_snapshot_model/HeapSnapshotModel.ts +1 -1
- package/front_end/models/issues_manager/ClientHintIssue.ts +95 -0
- package/front_end/models/issues_manager/ContentSecurityPolicyIssue.ts +6 -6
- package/front_end/models/issues_manager/ContrastCheckTrigger.ts +15 -15
- package/front_end/models/issues_manager/CorsIssue.ts +9 -9
- package/front_end/models/issues_manager/CrossOriginEmbedderPolicyIssue.ts +5 -5
- package/front_end/models/issues_manager/DeprecationIssue.ts +7 -7
- package/front_end/models/issues_manager/GenericIssue.ts +5 -5
- package/front_end/models/issues_manager/HeavyAdIssue.ts +5 -5
- package/front_end/models/issues_manager/Issue.ts +10 -10
- package/front_end/models/issues_manager/IssueResolver.ts +11 -10
- package/front_end/models/issues_manager/IssuesManager.ts +61 -56
- package/front_end/models/issues_manager/LowTextContrastIssue.ts +4 -4
- package/front_end/models/issues_manager/MixedContentIssue.ts +7 -7
- package/front_end/models/issues_manager/NavigatorUserAgentIssue.ts +7 -7
- package/front_end/models/issues_manager/QuirksModeIssue.ts +4 -4
- package/front_end/models/issues_manager/SameSiteCookieIssue.ts +17 -18
- package/front_end/models/issues_manager/SharedArrayBufferIssue.ts +5 -5
- package/front_end/models/issues_manager/SourceFrameIssuesManager.ts +32 -31
- package/front_end/models/issues_manager/TrustedWebActivityIssue.ts +5 -5
- package/front_end/models/issues_manager/WasmCrossOriginModuleSharingIssue.ts +5 -5
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/front_end/models/issues_manager/descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/front_end/models/issues_manager/issues_manager.ts +2 -0
- package/front_end/models/timeline_model/TimelineModel.ts +1 -1
- package/front_end/models/timeline_model/TracingLayerTree.ts +0 -1
- package/front_end/panels/accessibility/ARIAMetadata.ts +0 -1
- package/front_end/panels/accessibility/AXBreadcrumbsPane.ts +2 -2
- package/front_end/panels/accessibility/AccessibilityNodeView.ts +1 -2
- package/front_end/panels/animation/AnimationTimeline.ts +0 -1
- package/front_end/panels/application/ApplicationPanelCacheSection.ts +3 -4
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +0 -2
- package/front_end/panels/application/StorageView.ts +2 -6
- package/front_end/panels/application/{BackForwardCacheStrings.ts → components/BackForwardCacheStrings.ts} +2 -2
- package/front_end/panels/application/{BackForwardCacheView.ts → components/BackForwardCacheView.ts} +96 -62
- package/front_end/panels/application/components/EndpointsGrid.ts +12 -12
- package/front_end/panels/application/components/FrameDetailsView.ts +108 -110
- package/front_end/panels/application/components/OriginTrialTreeView.ts +45 -45
- package/front_end/panels/application/components/PermissionsPolicySection.ts +19 -19
- package/front_end/panels/application/components/ReportsGrid.ts +30 -30
- package/front_end/panels/application/components/StackTrace.ts +48 -47
- package/front_end/panels/application/components/TrustTokensView.ts +31 -31
- package/front_end/panels/application/{backForwardCacheView.css → components/backForwardCacheView.css} +9 -0
- package/front_end/panels/application/components/components.ts +2 -0
- package/front_end/panels/console/ConsoleView.ts +1 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -25
- package/front_end/panels/console/consoleView.css +5 -0
- package/front_end/panels/css_overview/CSSOverviewCompletedView.ts +41 -52
- package/front_end/panels/css_overview/CSSOverviewController.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewPanel.ts +18 -27
- package/front_end/panels/css_overview/CSSOverviewProcessingView.ts +2 -2
- package/front_end/panels/css_overview/CSSOverviewSidebarPanel.ts +6 -6
- package/front_end/panels/css_overview/components/CSSOverviewStartView.ts +4 -4
- package/front_end/panels/elements/ComputedStyleModel.ts +2 -2
- package/front_end/panels/elements/ElementsPanel.ts +1 -5
- package/front_end/panels/elements/ElementsTreeElement.ts +2 -6
- package/front_end/panels/elements/ElementsTreeOutline.ts +2 -2
- package/front_end/panels/elements/StylesSidebarPane.ts +1 -1
- package/front_end/panels/elements/components/AccessibilityTreeNode.ts +17 -17
- package/front_end/panels/elements/components/AdornerManager.ts +21 -21
- package/front_end/panels/elements/components/AdornerSettingsPane.ts +14 -14
- package/front_end/panels/elements/components/CSSQuery.ts +16 -16
- package/front_end/panels/elements/components/ComputedStyleProperty.ts +14 -14
- package/front_end/panels/elements/components/ComputedStyleTrace.ts +15 -15
- package/front_end/panels/elements/components/ElementsBreadcrumbs.ts +78 -78
- package/front_end/panels/elements/components/ElementsPanelLink.ts +16 -16
- package/front_end/panels/elements/components/LayoutPane.ts +47 -47
- package/front_end/panels/elements/components/NodeText.ts +18 -18
- package/front_end/panels/elements/components/QueryContainer.ts +40 -40
- package/front_end/panels/elements/components/StylePropertyEditor.ts +18 -18
- package/front_end/panels/emulation/components/DeviceSizeInputElement.ts +4 -4
- package/front_end/panels/event_listeners/EventListenersUtils.ts +2 -1
- package/front_end/panels/issues/AffectedBlockedByResponseView.ts +4 -4
- package/front_end/panels/issues/AffectedCookiesView.ts +4 -5
- package/front_end/panels/issues/AffectedDirectivesView.ts +19 -19
- package/front_end/panels/issues/AffectedDocumentsInQuirksModeView.ts +7 -8
- package/front_end/panels/issues/AffectedElementsView.ts +4 -4
- package/front_end/panels/issues/AffectedElementsWithLowContrastView.ts +7 -8
- package/front_end/panels/issues/AffectedHeavyAdView.ts +8 -8
- package/front_end/panels/issues/AffectedResourcesView.ts +25 -26
- package/front_end/panels/issues/AffectedSharedArrayBufferIssueDetailsView.ts +8 -8
- package/front_end/panels/issues/AffectedSourcesView.ts +4 -4
- package/front_end/panels/issues/AffectedTrustedWebActivityIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/AttributionReportingIssueDetailsView.ts +17 -17
- package/front_end/panels/issues/CSPViolationsListView.ts +22 -23
- package/front_end/panels/issues/CSPViolationsView.ts +17 -17
- package/front_end/panels/issues/ComboBoxOfCheckBoxes.ts +13 -13
- package/front_end/panels/issues/CorsIssueDetailsView.ts +23 -23
- package/front_end/panels/issues/GenericIssueDetailsView.ts +4 -4
- package/front_end/panels/issues/HiddenIssuesRow.ts +7 -7
- package/front_end/panels/issues/IssueAggregator.ts +95 -95
- package/front_end/panels/issues/IssueKindView.ts +14 -14
- package/front_end/panels/issues/IssueView.ts +98 -98
- package/front_end/panels/issues/IssuesPane.ts +102 -102
- package/front_end/panels/issues/WasmCrossOriginModuleSharingAffectedResourcesView.ts +5 -5
- package/front_end/panels/issues/components/HideIssuesMenu.ts +10 -10
- package/front_end/panels/layer_viewer/Layers3DView.ts +3 -9
- package/front_end/panels/lighthouse/LighthouseController.ts +4 -5
- package/front_end/panels/media/PlayerListView.ts +160 -97
- package/front_end/panels/media/PlayerMessagesView.ts +1 -0
- package/front_end/panels/media/TickingFlameChart.ts +1 -2
- package/front_end/panels/media/playerListView.css +58 -0
- package/front_end/panels/network/NetworkLogView.ts +2 -6
- package/front_end/panels/network/NetworkLogViewColumns.ts +1 -1
- package/front_end/panels/network/NetworkWaterfallColumn.ts +2 -4
- package/front_end/panels/network/components/RequestTrustTokensView.ts +40 -40
- package/front_end/panels/network/components/WebBundleInfoView.ts +9 -9
- package/front_end/panels/performance_monitor/PerformanceMonitor.ts +92 -37
- package/front_end/panels/performance_monitor/performanceMonitor.css +32 -0
- package/front_end/panels/profiler/HeapProfileView.ts +1 -1
- package/front_end/panels/profiler/HeapSnapshotDataGrids.ts +0 -1
- package/front_end/panels/profiler/HeapSnapshotView.ts +1 -2
- package/front_end/panels/protocol_monitor/ProtocolMonitor.ts +2 -2
- package/front_end/panels/search/SearchConfig.ts +0 -6
- package/front_end/panels/security/SecurityModel.ts +2 -4
- package/front_end/panels/security/SecurityPanel.ts +2 -2
- package/front_end/panels/settings/KeybindsSettingsTab.ts +4 -0
- package/front_end/panels/settings/components/SyncSection.ts +14 -14
- package/front_end/panels/settings/emulation/components/UserAgentClientHintsForm.ts +96 -96
- package/front_end/panels/sources/BreakpointEditDialog.ts +4 -3
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -2
- package/front_end/panels/sources/NavigatorView.ts +4 -10
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +2 -3
- package/front_end/panels/sources/SourceMapNamesResolver.ts +3 -3
- package/front_end/panels/sources/SourcesPanel.ts +1 -3
- package/front_end/panels/sources/SourcesView.ts +0 -3
- package/front_end/panels/sources/TabbedEditorContainer.ts +1 -4
- package/front_end/panels/timeline/TimelineFlameChartDataProvider.ts +2 -5
- package/front_end/panels/timeline/TimelineFlameChartNetworkDataProvider.ts +0 -1
- package/front_end/panels/timeline/TimelineFlameChartView.ts +1 -2
- package/front_end/panels/timeline/TimelineLoader.ts +0 -3
- package/front_end/panels/timeline/TimelinePanel.ts +2 -3
- package/front_end/panels/timeline/TimelineTreeView.ts +1 -1
- package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
- package/front_end/panels/timeline/components/WebVitalsLane.ts +77 -76
- package/front_end/panels/timeline/components/WebVitalsTimeline.ts +133 -133
- package/front_end/panels/timeline/components/WebVitalsTooltip.ts +9 -9
- package/front_end/panels/webauthn/WebauthnPane.ts +203 -205
- package/front_end/third_party/codemirror.next/bundle.ts +3 -3
- package/front_end/third_party/codemirror.next/chunk/codemirror.js +1 -1
- package/front_end/third_party/codemirror.next/chunk/markdown.js +2 -1
- package/front_end/third_party/codemirror.next/codemirror.next.d.ts +10 -1
- package/front_end/third_party/codemirror.next/codemirror.next.js +2 -1
- package/front_end/third_party/codemirror.next/package.json +3 -3
- package/front_end/third_party/diff/DiffWrapper.ts +7 -0
- package/front_end/third_party/puppeteer/package/README.md +11 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api-docs-entry.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Browser.d.ts +4 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/BrowserConnector.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Connection.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Coverage.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts +9 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js +21 -12
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/DOMWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Dialog.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/EvalTypes.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/ExecutionContext.d.ts +3 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FileChooser.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.d.ts +8 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts +50 -11
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js +70 -33
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts +12 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js +25 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Input.d.ts +2 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts +39 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js +36 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts +3 -4
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js +2 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts +46 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js +124 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkEventManager.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts +27 -10
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js +144 -74
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Puppeteer.d.ts +5 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/QueryHandler.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/Target.d.ts +4 -6
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/common/WebWorker.d.ts +3 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js +43 -17
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/BrowserRunner.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/LaunchOptions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js +101 -34
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Launcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/NodeWebSocketTransport.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/PipeTransport.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/node/Puppeteer.d.ts +5 -7
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api-docs-entry.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/AriaQueryHandler.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.d.ts +4 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Browser.js +2 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/BrowserConnector.js +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Connection.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.d.ts +1 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Coverage.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts +9 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js +24 -17
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/DOMWorld.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Dialog.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/EvalTypes.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/ExecutionContext.d.ts +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FileChooser.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.d.ts +8 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js +7 -8
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts +50 -11
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js +70 -34
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts +12 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js +26 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Input.d.ts +2 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts +39 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js +38 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts +3 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/LifecycleWatcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts +46 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js +120 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkEventManager.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts +27 -10
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js +144 -75
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Page.js +12 -14
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.d.ts +5 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Puppeteer.js +3 -4
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/QueryHandler.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/Target.d.ts +4 -6
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.d.ts +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/WebWorker.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/common/helper.js +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/initialize-node.js +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserFetcher.js +10 -12
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts +4 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js +43 -20
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/BrowserRunner.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/LaunchOptions.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js +104 -40
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Launcher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/NodeWebSocketTransport.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.d.ts +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/PipeTransport.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.d.ts +5 -7
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/Puppeteer.js +1 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node/install.js +3 -5
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node-puppeteer-core.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/node.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/web.js +1 -2
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +173 -36
- package/front_end/third_party/puppeteer/package/package.json +3 -3
- package/front_end/ui/components/adorners/Adorner.ts +2 -2
- package/front_end/ui/components/buttons/Button.ts +9 -9
- package/front_end/ui/components/data_grid/DataGrid.ts +64 -64
- package/front_end/ui/components/data_grid/DataGridController.ts +22 -22
- package/front_end/ui/components/data_grid/DataGridUtils.ts +3 -0
- package/front_end/ui/components/diff_view/DiffView.ts +6 -6
- package/front_end/ui/components/expandable_list/ExpandableList.ts +5 -5
- package/front_end/ui/components/icon_button/Icon.ts +4 -4
- package/front_end/ui/components/icon_button/IconButton.ts +4 -4
- package/front_end/ui/components/issue_counter/IssueCounter.ts +3 -3
- package/front_end/ui/components/issue_counter/IssueLinkIcon.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspector.ts +50 -50
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorController.ts +6 -6
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryInspectorPane.ts +4 -4
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryNavigator.ts +12 -12
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryValueInterpreter.ts +11 -11
- package/front_end/ui/components/linear_memory_inspector/LinearMemoryViewer.ts +40 -39
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterDisplay.ts +18 -18
- package/front_end/ui/components/linear_memory_inspector/ValueInterpreterSettings.ts +6 -6
- package/front_end/ui/components/linkifier/LinkifierImpl.ts +4 -4
- package/front_end/ui/components/markdown_view/MarkdownImage.ts +5 -5
- package/front_end/ui/components/markdown_view/MarkdownLink.ts +2 -2
- package/front_end/ui/components/markdown_view/MarkdownView.ts +4 -5
- package/front_end/ui/components/panel_feedback/FeedbackButton.ts +2 -2
- package/front_end/ui/components/panel_feedback/PanelFeedback.ts +2 -2
- package/front_end/ui/components/panel_feedback/PreviewToggle.ts +4 -4
- package/front_end/ui/components/render_coordinator/RenderCoordinator.ts +22 -22
- package/front_end/ui/components/report_view/ReportView.ts +16 -16
- package/front_end/ui/components/request_link_icon/RequestLinkIcon.ts +14 -14
- package/front_end/ui/components/settings/SettingCheckbox.ts +5 -5
- package/front_end/ui/components/survey_link/SurveyLink.ts +8 -8
- package/front_end/ui/components/text_editor/TextEditor.ts +9 -9
- package/front_end/ui/components/text_editor/cursor_tooltip.ts +7 -1
- package/front_end/ui/components/text_prompt/TextPrompt.ts +18 -18
- package/front_end/ui/components/tree_outline/TreeOutline.ts +69 -70
- package/front_end/ui/legacy/ContextFlavorListener.ts +0 -4
- package/front_end/ui/legacy/ContextMenu.ts +2 -3
- package/front_end/ui/legacy/InspectorView.ts +1 -1
- package/front_end/ui/legacy/ReportView.ts +3 -4
- package/front_end/ui/legacy/SearchableView.ts +14 -6
- package/front_end/ui/legacy/SplitWidget.ts +2 -3
- package/front_end/ui/legacy/SuggestBox.ts +0 -3
- package/front_end/ui/legacy/TextPrompt.ts +1 -1
- package/front_end/ui/legacy/UIUtils.ts +1 -1
- package/front_end/ui/legacy/XLink.ts +1 -1
- package/front_end/ui/legacy/components/color_picker/Spectrum.ts +2 -2
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +9 -9
- package/front_end/ui/legacy/components/data_grid/dataGrid.css +7 -7
- package/front_end/ui/legacy/components/inline_editor/CSSShadowEditor.ts +1 -1
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +1 -5
- package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
- package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +13 -13
- package/front_end/ui/legacy/components/source_frame/XMLView.ts +2 -2
- package/front_end/ui/legacy/components/utils/Linkifier.ts +2 -2
- package/front_end/ui/legacy/themeColors.css +2 -0
- package/front_end/ui/legacy/theme_support/theme_support_impl.ts +42 -4
- package/package.json +1 -1
- package/scripts/eslint_rules/lib/use_private_class_members.js +41 -0
- package/scripts/eslint_rules/tests/use_private_class_members_test.js +62 -0
- package/scripts/migration/class-fields/migrate.js +2 -3
- package/scripts/migration/class-fields/migrate.sh +1 -3
- package/scripts/migration/class-fields/package.json +1 -1
- package/config/gni/all_devtools_files.gni +0 -255
- package/scripts/build/devtools_file_hashes.py +0 -82
- package/scripts/devtools_run/devtools_run_cli +0 -49
- package/scripts/devtools_run/package.json +0 -13
- package/scripts/unzip.py +0 -20
- package/scripts/visualize_deps/jquery_svg.html +0 -57
- package/scripts/visualize_deps/run_visualize.js +0 -119
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
# Copyright 2020 The Chromium Authors. All rights reserved.
|
|
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("../../scripts/build/ninja/vars.gni")
|
|
6
|
-
|
|
7
|
-
all_devtools_files = [
|
|
8
|
-
"front_end/legacy_test_runner/accessibility_test_runner/accessibility_test_runner.js",
|
|
9
|
-
"front_end/legacy_test_runner/application_test_runner/application_test_runner.js",
|
|
10
|
-
"front_end/legacy_test_runner/bindings_test_runner/bindings_test_runner.js",
|
|
11
|
-
"front_end/legacy_test_runner/application_test_runner/CacheStorageTestRunner.js",
|
|
12
|
-
"front_end/legacy_test_runner/application_test_runner/IndexedDBTestRunner.js",
|
|
13
|
-
"front_end/legacy_test_runner/application_test_runner/ResourcesTestRunner.js",
|
|
14
|
-
"front_end/legacy_test_runner/application_test_runner/ResourceTreeTestRunner.js",
|
|
15
|
-
"front_end/legacy_test_runner/application_test_runner/ServiceWorkersTestRunner.js",
|
|
16
|
-
"front_end/legacy_test_runner/application_test_runner/StorageTestRunner.js",
|
|
17
|
-
"front_end/legacy_test_runner/lighthouse_test_runner/lighthouse_test_runner.js",
|
|
18
|
-
"front_end/legacy_test_runner/axe_core_test_runner/axe_core_test_runner.js",
|
|
19
|
-
"front_end/third_party/axe-core/axe.js",
|
|
20
|
-
"front_end/legacy_test_runner/bindings_test_runner/AutomappingTestRunner.js",
|
|
21
|
-
"front_end/legacy_test_runner/bindings_test_runner/BindingsTestRunner.js",
|
|
22
|
-
"front_end/legacy_test_runner/bindings_test_runner/IsolatedFilesystemTestRunner.js",
|
|
23
|
-
"front_end/legacy_test_runner/bindings_test_runner/OverridesTestRunner.js",
|
|
24
|
-
"front_end/legacy_test_runner/bindings_test_runner/PersistenceTestRunner.js",
|
|
25
|
-
"front_end/legacy_test_runner/console_test_runner/console_test_runner.js",
|
|
26
|
-
"front_end/legacy_test_runner/coverage_test_runner/coverage_test_runner.js",
|
|
27
|
-
"front_end/legacy_test_runner/cpu_profiler_test_runner/cpu_profiler_test_runner.js",
|
|
28
|
-
"front_end/legacy_test_runner/data_grid_test_runner/data_grid_test_runner.js",
|
|
29
|
-
"front_end/legacy_test_runner/device_mode_test_runner/device_mode_test_runner.js",
|
|
30
|
-
"front_end/legacy_test_runner/elements_test_runner/elements_test_runner.js",
|
|
31
|
-
"front_end/legacy_test_runner/elements_test_runner/EditDOMTestRunner.js",
|
|
32
|
-
"front_end/legacy_test_runner/elements_test_runner/ElementsPanelShadowSelectionOnRefreshTestRunner.js",
|
|
33
|
-
"front_end/legacy_test_runner/elements_test_runner/ElementsTestRunner.js",
|
|
34
|
-
"front_end/legacy_test_runner/elements_test_runner/SetOuterHTMLTestRunner.js",
|
|
35
|
-
"front_end/legacy_test_runner/elements_test_runner/StylesUpdateLinksTestRunner.js",
|
|
36
|
-
"front_end/legacy_test_runner/extensions_test_runner/extensions_test_runner.js",
|
|
37
|
-
"front_end/legacy_test_runner/extensions_test_runner/ExtensionsNetworkTestRunner.js",
|
|
38
|
-
"front_end/legacy_test_runner/extensions_test_runner/ExtensionsTestRunner.js",
|
|
39
|
-
"front_end/legacy_test_runner/heap_profiler_test_runner/heap_profiler_test_runner.js",
|
|
40
|
-
"front_end/legacy_test_runner/layers_test_runner/layers_test_runner.js",
|
|
41
|
-
"front_end/legacy_test_runner/network_test_runner/network_test_runner.js",
|
|
42
|
-
"front_end/legacy_test_runner/performance_test_runner/performance_test_runner.js",
|
|
43
|
-
"front_end/legacy_test_runner/performance_test_runner/TimelineDataTestRunner.js",
|
|
44
|
-
"front_end/legacy_test_runner/performance_test_runner/TimelineTestRunner.js",
|
|
45
|
-
"front_end/models/issues_manager/descriptions/arAttributionEventSourceTriggerDataTooLarge.md",
|
|
46
|
-
"front_end/models/issues_manager/descriptions/arAttributionSourceUntrustworthyFrameOrigin.md",
|
|
47
|
-
"front_end/models/issues_manager/descriptions/arAttributionSourceUntrustworthyOrigin.md",
|
|
48
|
-
"front_end/models/issues_manager/descriptions/arAttributionTriggerDataTooLarge.md",
|
|
49
|
-
"front_end/models/issues_manager/descriptions/arAttributionUntrustworthyFrameOrigin.md",
|
|
50
|
-
"front_end/models/issues_manager/descriptions/arAttributionUntrustworthyOrigin.md",
|
|
51
|
-
"front_end/models/issues_manager/descriptions/arInvalidAttributionData.md",
|
|
52
|
-
"front_end/models/issues_manager/descriptions/arInvalidAttributionSourceEventId.md",
|
|
53
|
-
"front_end/models/issues_manager/descriptions/arInvalidAttributionSourceExpiry.md",
|
|
54
|
-
"front_end/models/issues_manager/descriptions/arInvalidAttributionSourcePriority.md",
|
|
55
|
-
"front_end/models/issues_manager/descriptions/arInvalidEventSourceTriggerData.md",
|
|
56
|
-
"front_end/models/issues_manager/descriptions/arInvalidTriggerDedupKey.md",
|
|
57
|
-
"front_end/models/issues_manager/descriptions/arInvalidTriggerPriority.md",
|
|
58
|
-
"front_end/models/issues_manager/descriptions/arMissingAttributionData.md",
|
|
59
|
-
"front_end/models/issues_manager/descriptions/arPermissionPolicyDisabled.md",
|
|
60
|
-
"front_end/models/issues_manager/descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md",
|
|
61
|
-
"front_end/models/issues_manager/descriptions/CoepCorpNotSameSite.md",
|
|
62
|
-
"front_end/models/issues_manager/descriptions/CoepCorpNotSameOrigin.md",
|
|
63
|
-
"front_end/models/issues_manager/descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md",
|
|
64
|
-
"front_end/models/issues_manager/descriptions/CoepFrameResourceNeedsCoepHeader.md",
|
|
65
|
-
"front_end/models/issues_manager/descriptions/cspEvalViolation.md",
|
|
66
|
-
"front_end/models/issues_manager/descriptions/cspInlineViolation.md",
|
|
67
|
-
"front_end/models/issues_manager/descriptions/cspURLViolation.md",
|
|
68
|
-
"front_end/models/issues_manager/descriptions/deprecationNavigatorUserAgent.md",
|
|
69
|
-
"front_end/models/issues_manager/descriptions/LowTextContrast.md",
|
|
70
|
-
"front_end/models/issues_manager/descriptions/cspTrustedTypesSinkViolation.md",
|
|
71
|
-
"front_end/models/issues_manager/descriptions/cspTrustedTypesPolicyViolation.md",
|
|
72
|
-
"front_end/models/issues_manager/descriptions/CompatibilityModeQuirks.md",
|
|
73
|
-
"front_end/models/issues_manager/descriptions/heavyAd.md",
|
|
74
|
-
"front_end/models/issues_manager/descriptions/corsAllowCredentialsRequired.md",
|
|
75
|
-
"front_end/models/issues_manager/descriptions/corsDisallowedByMode.md",
|
|
76
|
-
"front_end/models/issues_manager/descriptions/corsDisabledScheme.md",
|
|
77
|
-
"front_end/models/issues_manager/descriptions/corsNoCorsRedirectModeNotFollow.md",
|
|
78
|
-
"front_end/models/issues_manager/descriptions/corsHeaderDisallowedByPreflightResponse.md",
|
|
79
|
-
"front_end/models/issues_manager/descriptions/corsInvalidHeaderValues.md",
|
|
80
|
-
"front_end/models/issues_manager/descriptions/corsMethodDisallowedByPreflightResponse.md",
|
|
81
|
-
"front_end/models/issues_manager/descriptions/corsOriginMismatch.md",
|
|
82
|
-
"front_end/models/issues_manager/descriptions/corsPreflightResponseInvalid.md",
|
|
83
|
-
"front_end/models/issues_manager/descriptions/corsRedirectContainsCredentials.md",
|
|
84
|
-
"front_end/models/issues_manager/descriptions/corsWildcardOriginNotAllowed.md",
|
|
85
|
-
"front_end/models/issues_manager/descriptions/mixedContent.md",
|
|
86
|
-
"front_end/models/issues_manager/descriptions/sharedArrayBuffer.md",
|
|
87
|
-
"front_end/models/issues_manager/descriptions/corsInsecurePrivateNetwork.md",
|
|
88
|
-
"front_end/models/issues_manager/descriptions/corsPreflightAllowPrivateNetworkError.md",
|
|
89
|
-
"front_end/models/issues_manager/descriptions/SameSiteExcludeContextDowngradeRead.md",
|
|
90
|
-
"front_end/models/issues_manager/descriptions/SameSiteExcludeContextDowngradeSet.md",
|
|
91
|
-
"front_end/models/issues_manager/descriptions/SameSiteExcludeNavigationContextDowngrade.md",
|
|
92
|
-
"front_end/models/issues_manager/descriptions/SameSiteInvalidSameParty.md",
|
|
93
|
-
"front_end/models/issues_manager/descriptions/SameSiteNoneInsecureErrorRead.md",
|
|
94
|
-
"front_end/models/issues_manager/descriptions/SameSiteNoneInsecureErrorSet.md",
|
|
95
|
-
"front_end/models/issues_manager/descriptions/SameSiteNoneInsecureWarnRead.md",
|
|
96
|
-
"front_end/models/issues_manager/descriptions/SameSiteNoneInsecureWarnSet.md",
|
|
97
|
-
"front_end/models/issues_manager/descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md",
|
|
98
|
-
"front_end/models/issues_manager/descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md",
|
|
99
|
-
"front_end/models/issues_manager/descriptions/SameSiteUnspecifiedTreatedAsLaxRead.md",
|
|
100
|
-
"front_end/models/issues_manager/descriptions/SameSiteUnspecifiedTreatedAsLaxSet.md",
|
|
101
|
-
"front_end/models/issues_manager/descriptions/SameSiteWarnCrossDowngradeRead.md",
|
|
102
|
-
"front_end/models/issues_manager/descriptions/SameSiteWarnCrossDowngradeSet.md",
|
|
103
|
-
"front_end/models/issues_manager/descriptions/SameSiteWarnStrictLaxDowngradeStrict.md",
|
|
104
|
-
"front_end/models/issues_manager/descriptions/TwaDigitalAssetLinksFailed.md",
|
|
105
|
-
"front_end/models/issues_manager/descriptions/TwaHttpError.md",
|
|
106
|
-
"front_end/models/issues_manager/descriptions/TwaPageUnavailableOffline.md",
|
|
107
|
-
"front_end/legacy_test_runner/sdk_test_runner/sdk_test_runner.js",
|
|
108
|
-
"front_end/legacy_test_runner/security_test_runner/security_test_runner.js",
|
|
109
|
-
"front_end/legacy_test_runner/sources_test_runner/sources_test_runner.js",
|
|
110
|
-
"front_end/legacy_test_runner/sources_test_runner/AutocompleteTestRunner.js",
|
|
111
|
-
"front_end/legacy_test_runner/sources_test_runner/DebuggerTestRunner.js",
|
|
112
|
-
"front_end/legacy_test_runner/sources_test_runner/EditorTestRunner.js",
|
|
113
|
-
"front_end/legacy_test_runner/sources_test_runner/LiveEditTestRunner.js",
|
|
114
|
-
"front_end/legacy_test_runner/sources_test_runner/SearchTestRunner.js",
|
|
115
|
-
"front_end/legacy_test_runner/sources_test_runner/SourcesTestRunner.js",
|
|
116
|
-
]
|
|
117
|
-
|
|
118
|
-
lighthouse_locale_files = [
|
|
119
|
-
"locales/ar-XB.json",
|
|
120
|
-
"locales/ar.json",
|
|
121
|
-
"locales/bg.json",
|
|
122
|
-
"locales/ca.json",
|
|
123
|
-
"locales/cs.json",
|
|
124
|
-
"locales/da.json",
|
|
125
|
-
"locales/de.json",
|
|
126
|
-
"locales/el.json",
|
|
127
|
-
"locales/en-GB.json",
|
|
128
|
-
"locales/en-US.json",
|
|
129
|
-
"locales/en-XA.json",
|
|
130
|
-
"locales/en-XL.json",
|
|
131
|
-
"locales/es-419.json",
|
|
132
|
-
"locales/es.json",
|
|
133
|
-
"locales/fi.json",
|
|
134
|
-
"locales/fil.json",
|
|
135
|
-
"locales/fr.json",
|
|
136
|
-
"locales/he.json",
|
|
137
|
-
"locales/hi.json",
|
|
138
|
-
"locales/hr.json",
|
|
139
|
-
"locales/hu.json",
|
|
140
|
-
"locales/id.json",
|
|
141
|
-
"locales/it.json",
|
|
142
|
-
"locales/ja.json",
|
|
143
|
-
"locales/ko.json",
|
|
144
|
-
"locales/lt.json",
|
|
145
|
-
"locales/lv.json",
|
|
146
|
-
"locales/nl.json",
|
|
147
|
-
"locales/no.json",
|
|
148
|
-
"locales/pl.json",
|
|
149
|
-
"locales/pt-PT.json",
|
|
150
|
-
"locales/pt.json",
|
|
151
|
-
"locales/ro.json",
|
|
152
|
-
"locales/ru.json",
|
|
153
|
-
"locales/sk.json",
|
|
154
|
-
"locales/sl.json",
|
|
155
|
-
"locales/sr-Latn.json",
|
|
156
|
-
"locales/sr.json",
|
|
157
|
-
"locales/sv.json",
|
|
158
|
-
"locales/ta.json",
|
|
159
|
-
"locales/te.json",
|
|
160
|
-
"locales/th.json",
|
|
161
|
-
"locales/tr.json",
|
|
162
|
-
"locales/uk.json",
|
|
163
|
-
"locales/vi.json",
|
|
164
|
-
"locales/zh-HK.json",
|
|
165
|
-
"locales/zh-TW.json",
|
|
166
|
-
"locales/zh.json",
|
|
167
|
-
]
|
|
168
|
-
|
|
169
|
-
remote_devtools_locale_files = [
|
|
170
|
-
"af.json",
|
|
171
|
-
"am.json",
|
|
172
|
-
"ar.json",
|
|
173
|
-
"as.json",
|
|
174
|
-
"az.json",
|
|
175
|
-
"be.json",
|
|
176
|
-
"bg.json",
|
|
177
|
-
"bn.json",
|
|
178
|
-
"bs.json",
|
|
179
|
-
"ca.json",
|
|
180
|
-
"cs.json",
|
|
181
|
-
"cy.json",
|
|
182
|
-
"da.json",
|
|
183
|
-
"de.json",
|
|
184
|
-
"el.json",
|
|
185
|
-
"en-GB.json",
|
|
186
|
-
"es-419.json",
|
|
187
|
-
"es.json",
|
|
188
|
-
"et.json",
|
|
189
|
-
"eu.json",
|
|
190
|
-
"fa.json",
|
|
191
|
-
"fi.json",
|
|
192
|
-
"fil.json",
|
|
193
|
-
"fr-CA.json",
|
|
194
|
-
"fr.json",
|
|
195
|
-
"gl.json",
|
|
196
|
-
"gu.json",
|
|
197
|
-
"he.json",
|
|
198
|
-
"hi.json",
|
|
199
|
-
"hr.json",
|
|
200
|
-
"hu.json",
|
|
201
|
-
"hy.json",
|
|
202
|
-
"id.json",
|
|
203
|
-
"is.json",
|
|
204
|
-
"it.json",
|
|
205
|
-
"ja.json",
|
|
206
|
-
"ka.json",
|
|
207
|
-
"kk.json",
|
|
208
|
-
"km.json",
|
|
209
|
-
"kn.json",
|
|
210
|
-
"ko.json",
|
|
211
|
-
"ky.json",
|
|
212
|
-
"lo.json",
|
|
213
|
-
"lt.json",
|
|
214
|
-
"lv.json",
|
|
215
|
-
"mk.json",
|
|
216
|
-
"ml.json",
|
|
217
|
-
"mn.json",
|
|
218
|
-
"mr.json",
|
|
219
|
-
"ms.json",
|
|
220
|
-
"my.json",
|
|
221
|
-
"ne.json",
|
|
222
|
-
"nl.json",
|
|
223
|
-
"no.json",
|
|
224
|
-
"or.json",
|
|
225
|
-
"pa.json",
|
|
226
|
-
"pl.json",
|
|
227
|
-
"pt-PT.json",
|
|
228
|
-
"pt.json",
|
|
229
|
-
"ro.json",
|
|
230
|
-
"ru.json",
|
|
231
|
-
"si.json",
|
|
232
|
-
"sk.json",
|
|
233
|
-
"sl.json",
|
|
234
|
-
"sq.json",
|
|
235
|
-
"sr-Latn.json",
|
|
236
|
-
"sr.json",
|
|
237
|
-
"sv.json",
|
|
238
|
-
"sw.json",
|
|
239
|
-
"ta.json",
|
|
240
|
-
"te.json",
|
|
241
|
-
"th.json",
|
|
242
|
-
"tr.json",
|
|
243
|
-
"uk.json",
|
|
244
|
-
"ur.json",
|
|
245
|
-
"uz.json",
|
|
246
|
-
"vi.json",
|
|
247
|
-
"zh-HK.json",
|
|
248
|
-
"zh-TW.json",
|
|
249
|
-
"zu.json",
|
|
250
|
-
]
|
|
251
|
-
|
|
252
|
-
bundled_devtools_locale_files = [
|
|
253
|
-
"en-US.json",
|
|
254
|
-
"zh.json",
|
|
255
|
-
]
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
# Copyright (c) 2014 Google Inc. All rights reserved.
|
|
2
|
-
#
|
|
3
|
-
# Redistribution and use in source and binary forms, with or without
|
|
4
|
-
# modification, are permitted provided that the following conditions are
|
|
5
|
-
# met:
|
|
6
|
-
#
|
|
7
|
-
# * Redistributions of source code must retain the above copyright
|
|
8
|
-
# notice, this list of conditions and the following disclaimer.
|
|
9
|
-
# * Redistributions in binary form must reproduce the above
|
|
10
|
-
# copyright notice, this list of conditions and the following disclaimer
|
|
11
|
-
# in the documentation and/or other materials provided with the
|
|
12
|
-
# distribution.
|
|
13
|
-
# * Neither the name of Google Inc. nor the names of its
|
|
14
|
-
# contributors may be used to endorse or promote products derived from
|
|
15
|
-
# this software without specific prior written permission.
|
|
16
|
-
#
|
|
17
|
-
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
18
|
-
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
19
|
-
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
|
20
|
-
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
|
21
|
-
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
22
|
-
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
23
|
-
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
24
|
-
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
25
|
-
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
26
|
-
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
27
|
-
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
28
|
-
|
|
29
|
-
import hashlib
|
|
30
|
-
import os.path
|
|
31
|
-
|
|
32
|
-
try:
|
|
33
|
-
import json
|
|
34
|
-
except ImportError:
|
|
35
|
-
import simplejson as json
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
def save_hashes(hashes_file_path, hashes):
|
|
39
|
-
try:
|
|
40
|
-
with open(hashes_file_path, "wt") as hashes_file:
|
|
41
|
-
json.dump(hashes,
|
|
42
|
-
hashes_file,
|
|
43
|
-
indent=4,
|
|
44
|
-
separators=(",", ": "),
|
|
45
|
-
sort_keys=True)
|
|
46
|
-
except:
|
|
47
|
-
print("ERROR: Failed to write %s" % hashes_file_path)
|
|
48
|
-
raise
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
def load_hashes(hashes_file_path):
|
|
52
|
-
try:
|
|
53
|
-
with open(hashes_file_path, "r") as hashes_file:
|
|
54
|
-
hashes = json.load(hashes_file)
|
|
55
|
-
except:
|
|
56
|
-
return {}
|
|
57
|
-
return hashes
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def calculate_file_hash(file_path):
|
|
61
|
-
with open(file_path, "rb") as file:
|
|
62
|
-
data = file.read()
|
|
63
|
-
md5_hash = hashlib.md5(data).hexdigest()
|
|
64
|
-
return md5_hash
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
def files_with_invalid_hashes(hash_file_path, file_paths):
|
|
68
|
-
hashes = load_hashes(hash_file_path)
|
|
69
|
-
result = []
|
|
70
|
-
for file_path in file_paths:
|
|
71
|
-
file_name = os.path.basename(file_path)
|
|
72
|
-
if calculate_file_hash(file_path) != hashes.get(file_name, ""):
|
|
73
|
-
result.append(file_path)
|
|
74
|
-
return result
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
def update_file_hashes(hash_file_path, file_paths):
|
|
78
|
-
hashes = {}
|
|
79
|
-
for file_path in file_paths:
|
|
80
|
-
file_name = os.path.basename(file_path)
|
|
81
|
-
hashes[file_name] = calculate_file_hash(file_path)
|
|
82
|
-
save_hashes(hash_file_path, hashes)
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// Copyright 2016 The Chromium Authors. All rights reserved.
|
|
4
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
5
|
-
// found in the LICENSE file.
|
|
6
|
-
|
|
7
|
-
var childProcess = require('child_process');
|
|
8
|
-
var fs = require('fs');
|
|
9
|
-
var path = require('path');
|
|
10
|
-
var shell = require('child_process').execSync;
|
|
11
|
-
|
|
12
|
-
var repoRootPath;
|
|
13
|
-
try {
|
|
14
|
-
repoRootPath = shellOutput('git rev-parse --show-toplevel');
|
|
15
|
-
} catch (error) {
|
|
16
|
-
console.log('ERROR: cannot use dtrun outside of chromium repo');
|
|
17
|
-
process.exit(1);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
var devtoolsPath = path.join(repoRootPath, 'third_party', 'devtools-frontend', 'src');
|
|
21
|
-
|
|
22
|
-
if (!isDir(devtoolsPath)) {
|
|
23
|
-
console.log('ERROR: cannot use dtrun outside of chromium repo');
|
|
24
|
-
process.exit(1);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var npmPath = shellOutput('which npm');
|
|
28
|
-
var args = ['run'];
|
|
29
|
-
if (process.argv.length > 2) {
|
|
30
|
-
args.push(process.argv[2]);
|
|
31
|
-
args.push('--');
|
|
32
|
-
args = args.concat(process.argv.slice(3));
|
|
33
|
-
}
|
|
34
|
-
var child = childProcess.spawn(npmPath, args, {
|
|
35
|
-
cwd: devtoolsPath,
|
|
36
|
-
stdio: 'inherit',
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
function shellOutput(command) {
|
|
40
|
-
return shell(command).toString().trim();
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function isDir(path) {
|
|
44
|
-
try {
|
|
45
|
-
return fs.statSync(path).isDirectory();
|
|
46
|
-
} catch (error) {
|
|
47
|
-
return false;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "devtools-run",
|
|
3
|
-
"description": "cli helper for using devtools npm commands anywhere in a chromium repo",
|
|
4
|
-
"version": "0.1.0",
|
|
5
|
-
"author": "The Chromium Authors",
|
|
6
|
-
"license": "SEE LICENSE IN https://chromium.googlesource.com/chromium/src/+/main/LICENSE",
|
|
7
|
-
"bugs": {
|
|
8
|
-
"url": "https://bugs.chromium.org/p/chromium/issues/list?can=2&q=component:Platform%3EDevTools%20&sort=-opened&colspec=ID%20Stars%20Owner%20Summary%20Modified%20Opened"
|
|
9
|
-
},
|
|
10
|
-
"bin": {
|
|
11
|
-
"dtrun": "./devtools_run_cli"
|
|
12
|
-
}
|
|
13
|
-
}
|
package/scripts/unzip.py
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env vpython
|
|
2
|
-
# Copyright 2016 The Chromium Authors. All rights reserved.
|
|
3
|
-
# Use of this source code is governed by a BSD-style license that can be
|
|
4
|
-
# found in the LICENSE file.
|
|
5
|
-
|
|
6
|
-
import sys
|
|
7
|
-
import zipfile
|
|
8
|
-
|
|
9
|
-
if len(sys.argv) < 3:
|
|
10
|
-
print('Usage: {} <src> <dest>'.format(sys.argv[0]))
|
|
11
|
-
print(' <src> full path to zip file to be extracted')
|
|
12
|
-
print(' <dest> full path to destination folder')
|
|
13
|
-
sys.exit(1)
|
|
14
|
-
|
|
15
|
-
src = sys.argv[1]
|
|
16
|
-
dest = sys.argv[2]
|
|
17
|
-
|
|
18
|
-
zip_ref = zipfile.ZipFile(src, 'r')
|
|
19
|
-
zip_ref.extractall(dest)
|
|
20
|
-
zip_ref.close()
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* Copyright (c) 2015 Mountainstorm
|
|
3
|
-
*
|
|
4
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
6
|
-
* in the Software without restriction, including without limitation the rights
|
|
7
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
9
|
-
* furnished to do so, subject to the following conditions:
|
|
10
|
-
*
|
|
11
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
12
|
-
* copies or substantial portions of the Software.
|
|
13
|
-
*
|
|
14
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
-
* SOFTWARE.
|
|
21
|
-
-->
|
|
22
|
-
<html>
|
|
23
|
-
<head>
|
|
24
|
-
<link rel="stylesheet" href="http://cdn.rawgit.com/mountainstorm/jquery.graphviz.svg/master/css/graphviz.svg.css">
|
|
25
|
-
</head>
|
|
26
|
-
<body>
|
|
27
|
-
<div id="graph" style="width: 100%; height: 100%; overflow: scroll; position: relative;"></div>
|
|
28
|
-
<script type="text/javascript" src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
|
|
29
|
-
<script type="text/javascript" src="https://cdn.rawgit.com/jquery/jquery-mousewheel/master/jquery.mousewheel.min.js"></script>
|
|
30
|
-
<script type="text/javascript" src="https://cdn.rawgit.com/jquery/jquery-color/master/jquery.color.js"></script>
|
|
31
|
-
<script type="text/javascript" src="http://cdn.rawgit.com/mountainstorm/jquery.graphviz.svg/master/js/jquery.graphviz.svg.js"></script>
|
|
32
|
-
|
|
33
|
-
<script>
|
|
34
|
-
$(document).ready(function() {
|
|
35
|
-
$("#graph").graphviz({
|
|
36
|
-
url: "out/dependencies.dot.svg",
|
|
37
|
-
ready: function() {
|
|
38
|
-
var gv = this
|
|
39
|
-
gv.nodes().click(function() {
|
|
40
|
-
var $set = $()
|
|
41
|
-
$set.push(this)
|
|
42
|
-
$set = $set.add(gv.linkedFrom(this, true))
|
|
43
|
-
$set = $set.add(gv.linkedTo(this, true))
|
|
44
|
-
gv.highlight($set, true)
|
|
45
|
-
gv.bringToFront($set)
|
|
46
|
-
})
|
|
47
|
-
$(document).keydown(function(evt) {
|
|
48
|
-
if (evt.keyCode == 27) {
|
|
49
|
-
gv.highlight()
|
|
50
|
-
}
|
|
51
|
-
})
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
</script>
|
|
56
|
-
</body>
|
|
57
|
-
</html>
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
// Copyright 2016 The Chromium Authors. All rights reserved.
|
|
2
|
-
// Use of this source code is governed by a BSD-style license that can be
|
|
3
|
-
// found in the LICENSE file.
|
|
4
|
-
|
|
5
|
-
'use strict';
|
|
6
|
-
|
|
7
|
-
const childProcess = require('child_process');
|
|
8
|
-
const fs = require('fs');
|
|
9
|
-
const http = require('http');
|
|
10
|
-
const path = require('path');
|
|
11
|
-
const parseURL = require('url').parse;
|
|
12
|
-
|
|
13
|
-
const utils = require('../utils');
|
|
14
|
-
|
|
15
|
-
const FRONTEND_PATH = path.resolve(__dirname, '..', '..', 'front_end');
|
|
16
|
-
const OUT_DIR_PATH = path.resolve(__dirname, 'out');
|
|
17
|
-
const OUT_FILE_PATH = path.resolve(OUT_DIR_PATH, 'dependencies.dot');
|
|
18
|
-
|
|
19
|
-
const SERVER_PORT = parseInt(process.env.PORT, 10) || 8001;
|
|
20
|
-
|
|
21
|
-
function main() {
|
|
22
|
-
generateDot();
|
|
23
|
-
try {
|
|
24
|
-
childProcess.execSync(`dot -O -Tsvg ${OUT_FILE_PATH}`);
|
|
25
|
-
} catch (err) {
|
|
26
|
-
console.log(`Could not generate dot svg because: ${err}`);
|
|
27
|
-
console.log('Make sure you have graphviz installed (e.g. sudo apt install graphviz)');
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
console.log('Generated dot file & svg');
|
|
31
|
-
startServer();
|
|
32
|
-
console.log(`Go to: http://localhost:${SERVER_PORT}/jquery_svg.html`);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function generateDot() {
|
|
36
|
-
if (!utils.isDir(OUT_DIR_PATH)) {
|
|
37
|
-
fs.mkdirSync(OUT_DIR_PATH);
|
|
38
|
-
}
|
|
39
|
-
const modules = new Set();
|
|
40
|
-
const moduleToDependencyList = ['digraph dependencies {'];
|
|
41
|
-
moduleToDependencyList.push('fixedsize = true;');
|
|
42
|
-
fs.readdirSync(FRONTEND_PATH).forEach(function(file) {
|
|
43
|
-
const moduleJSONPath = path.join(FRONTEND_PATH, file, 'module.json');
|
|
44
|
-
if (fs.statSync(path.join(FRONTEND_PATH, file)).isDirectory() && utils.isFile(moduleJSONPath)) {
|
|
45
|
-
const module = file;
|
|
46
|
-
if (module === 'lighthouse_worker') {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
modules.add(module);
|
|
50
|
-
const moduleJSON = require(moduleJSONPath);
|
|
51
|
-
let moduleSize = 0;
|
|
52
|
-
|
|
53
|
-
const resources = moduleJSON.resources || [];
|
|
54
|
-
for (const script of resources) {
|
|
55
|
-
if (fs.existsSync(path.join(FRONTEND_PATH, module, script))) {
|
|
56
|
-
moduleSize += fs.statSync(path.join(FRONTEND_PATH, module, script)).size;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
moduleSize /= 200000;
|
|
60
|
-
moduleSize = Math.max(0.5, moduleSize);
|
|
61
|
-
const fontSize = Math.max(moduleSize * 14, 14);
|
|
62
|
-
|
|
63
|
-
moduleToDependencyList.push(`${module} [width=${moduleSize}, height=${moduleSize} fontsize=${fontSize}];`);
|
|
64
|
-
|
|
65
|
-
if (moduleJSON.dependencies) {
|
|
66
|
-
for (const d of moduleJSON.dependencies) {
|
|
67
|
-
moduleToDependencyList.push(` ${module} -> ${d}`);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
moduleToDependencyList.push('}');
|
|
73
|
-
const content = moduleToDependencyList.join('\n');
|
|
74
|
-
fs.writeFileSync(OUT_FILE_PATH, content);
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
function startServer() {
|
|
78
|
-
http.createServer(requestHandler).listen(SERVER_PORT);
|
|
79
|
-
|
|
80
|
-
function requestHandler(request, response) {
|
|
81
|
-
const filePath = parseURL(request.url).pathname;
|
|
82
|
-
const absoluteFilePath = path.join(__dirname, filePath);
|
|
83
|
-
if (!path.resolve(absoluteFilePath).startsWith(__dirname)) {
|
|
84
|
-
console.log(`File requested is outside of folder: ${__dirname}`);
|
|
85
|
-
sendResponse(403, `403 - Access denied. File requested is outside of folder: ${__dirname}`);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
fs.exists(absoluteFilePath, fsExistsCallback);
|
|
90
|
-
|
|
91
|
-
function fsExistsCallback(fileExists) {
|
|
92
|
-
if (!fileExists) {
|
|
93
|
-
console.log(`Cannot find file ${absoluteFilePath}`);
|
|
94
|
-
sendResponse(404, '404 - File not found');
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
fs.readFile(absoluteFilePath, 'binary', readFileCallback);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function readFileCallback(err, file) {
|
|
101
|
-
if (err) {
|
|
102
|
-
console.log(`Unable to read local file ${absoluteFilePath}:`, err);
|
|
103
|
-
sendResponse(500, '500 - Internal Server Error');
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
sendResponse(200, file);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
function sendResponse(statusCode, data) {
|
|
110
|
-
response.writeHead(statusCode);
|
|
111
|
-
response.write(data, 'binary');
|
|
112
|
-
response.end();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (require.main === module) {
|
|
118
|
-
main();
|
|
119
|
-
}
|