devtools-tracing 1.0.0
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/generate.ts +643 -0
- package/index.ts +16 -0
- package/lib/front_end/core/common/App.ts +7 -0
- package/lib/front_end/core/common/AppProvider.ts +32 -0
- package/lib/front_end/core/common/Base64.ts +47 -0
- package/lib/front_end/core/common/CharacterIdMap.ts +30 -0
- package/lib/front_end/core/common/Color.ts +2506 -0
- package/lib/front_end/core/common/ColorConverter.ts +402 -0
- package/lib/front_end/core/common/ColorUtils.ts +252 -0
- package/lib/front_end/core/common/Console.ts +114 -0
- package/lib/front_end/core/common/Debouncer.ts +15 -0
- package/lib/front_end/core/common/EventTarget.ts +52 -0
- package/lib/front_end/core/common/Gzip.ts +74 -0
- package/lib/front_end/core/common/JavaScriptMetaData.ts +29 -0
- package/lib/front_end/core/common/Lazy.ts +31 -0
- package/lib/front_end/core/common/Linkifier.ts +55 -0
- package/lib/front_end/core/common/MapWithDefault.ts +26 -0
- package/lib/front_end/core/common/Mutex.ts +55 -0
- package/lib/front_end/core/common/Object.ts +145 -0
- package/lib/front_end/core/common/ParsedURL.ts +554 -0
- package/lib/front_end/core/common/Progress.ts +180 -0
- package/lib/front_end/core/common/QueryParamHandler.ts +7 -0
- package/lib/front_end/core/common/ResolverBase.ts +85 -0
- package/lib/front_end/core/common/ResourceType.ts +588 -0
- package/lib/front_end/core/common/ReturnToPanel.ts +17 -0
- package/lib/front_end/core/common/Revealer.ts +192 -0
- package/lib/front_end/core/common/Runnable.ts +41 -0
- package/lib/front_end/core/common/SegmentedRange.ts +87 -0
- package/lib/front_end/core/common/SettingRegistration.ts +339 -0
- package/lib/front_end/core/common/Settings.ts +1497 -0
- package/lib/front_end/core/common/SimpleHistoryManager.ts +124 -0
- package/lib/front_end/core/common/StringOutputStream.ts +26 -0
- package/lib/front_end/core/common/TextDictionary.ts +48 -0
- package/lib/front_end/core/common/Throttler.ts +99 -0
- package/lib/front_end/core/common/Trie.ts +152 -0
- package/lib/front_end/core/common/Worker.ts +60 -0
- package/lib/front_end/core/common/common.ts +81 -0
- package/lib/front_end/core/host/AidaClient.ts +733 -0
- package/lib/front_end/core/host/GdpClient.ts +316 -0
- package/lib/front_end/core/host/InspectorFrontendHost.ts +648 -0
- package/lib/front_end/core/host/InspectorFrontendHostAPI.ts +551 -0
- package/lib/front_end/core/host/Platform.ts +76 -0
- package/lib/front_end/core/host/ResourceLoader.ts +282 -0
- package/lib/front_end/core/host/UserMetrics.ts +1230 -0
- package/lib/front_end/core/host/host.ts +23 -0
- package/lib/front_end/core/i18n/ByteUtilities.ts +82 -0
- package/lib/front_end/core/i18n/DevToolsLocale.ts +87 -0
- package/lib/front_end/core/i18n/NumberFormatter.ts +82 -0
- package/lib/front_end/core/i18n/i18n.ts +17 -0
- package/lib/front_end/core/i18n/i18nImpl.ts +204 -0
- package/lib/front_end/core/i18n/i18nTypes.ts +10 -0
- package/lib/front_end/core/i18n/locales.js +14 -0
- package/lib/front_end/core/i18n/time-utilities.ts +174 -0
- package/lib/front_end/core/platform/ArrayUtilities.ts +271 -0
- package/lib/front_end/core/platform/Brand.ts +23 -0
- package/lib/front_end/core/platform/Constructor.ts +10 -0
- package/lib/front_end/core/platform/DOMUtilities.ts +138 -0
- package/lib/front_end/core/platform/DateUtilities.ts +15 -0
- package/lib/front_end/core/platform/DevToolsPath.ts +53 -0
- package/lib/front_end/core/platform/KeyboardUtilities.ts +38 -0
- package/lib/front_end/core/platform/MapUtilities.ts +95 -0
- package/lib/front_end/core/platform/MimeType.ts +175 -0
- package/lib/front_end/core/platform/NumberUtilities.ts +80 -0
- package/lib/front_end/core/platform/StringUtilities.ts +588 -0
- package/lib/front_end/core/platform/Timing.ts +17 -0
- package/lib/front_end/core/platform/TypedArrayUtilities.ts +189 -0
- package/lib/front_end/core/platform/TypescriptUtilities.ts +86 -0
- package/lib/front_end/core/platform/UIString.ts +39 -0
- package/lib/front_end/core/platform/UserVisibleError.ts +28 -0
- package/lib/front_end/core/platform/platform.ts +45 -0
- package/lib/front_end/core/protocol_client/ConnectionTransport.ts +26 -0
- package/lib/front_end/core/protocol_client/InspectorBackend.ts +1050 -0
- package/lib/front_end/core/protocol_client/NodeURL.ts +42 -0
- package/lib/front_end/core/protocol_client/protocol_client.ts +13 -0
- package/lib/front_end/core/root/Runtime.ts +609 -0
- package/lib/front_end/core/root/root.ts +6 -0
- package/lib/front_end/core/sdk/AccessibilityModel.ts +353 -0
- package/lib/front_end/core/sdk/AnimationModel.ts +1041 -0
- package/lib/front_end/core/sdk/AutofillModel.ts +184 -0
- package/lib/front_end/core/sdk/CPUProfilerModel.ts +148 -0
- package/lib/front_end/core/sdk/CPUThrottlingManager.ts +282 -0
- package/lib/front_end/core/sdk/CSSContainerQuery.ts +139 -0
- package/lib/front_end/core/sdk/CSSFontFace.ts +40 -0
- package/lib/front_end/core/sdk/CSSLayer.ts +30 -0
- package/lib/front_end/core/sdk/CSSMatchedStyles.ts +1646 -0
- package/lib/front_end/core/sdk/CSSMedia.ts +121 -0
- package/lib/front_end/core/sdk/CSSMetadata.ts +1647 -0
- package/lib/front_end/core/sdk/CSSModel.ts +1128 -0
- package/lib/front_end/core/sdk/CSSProperty.ts +384 -0
- package/lib/front_end/core/sdk/CSSPropertyParser.ts +681 -0
- package/lib/front_end/core/sdk/CSSPropertyParserMatchers.ts +1395 -0
- package/lib/front_end/core/sdk/CSSQuery.ts +72 -0
- package/lib/front_end/core/sdk/CSSRule.ts +465 -0
- package/lib/front_end/core/sdk/CSSScope.ts +30 -0
- package/lib/front_end/core/sdk/CSSStartingStyle.ts +29 -0
- package/lib/front_end/core/sdk/CSSStyleDeclaration.ts +313 -0
- package/lib/front_end/core/sdk/CSSStyleSheetHeader.ts +196 -0
- package/lib/front_end/core/sdk/CSSSupports.ts +33 -0
- package/lib/front_end/core/sdk/CategorizedBreakpoint.ts +64 -0
- package/lib/front_end/core/sdk/ChildTargetManager.ts +314 -0
- package/lib/front_end/core/sdk/CompilerSourceMappingContentProvider.ts +62 -0
- package/lib/front_end/core/sdk/Connections.ts +293 -0
- package/lib/front_end/core/sdk/ConsoleModel.ts +808 -0
- package/lib/front_end/core/sdk/ConsoleModelTypes.ts +15 -0
- package/lib/front_end/core/sdk/Cookie.ts +319 -0
- package/lib/front_end/core/sdk/CookieModel.ts +239 -0
- package/lib/front_end/core/sdk/CookieParser.ts +185 -0
- package/lib/front_end/core/sdk/DOMDebuggerModel.ts +787 -0
- package/lib/front_end/core/sdk/DOMModel.ts +1961 -0
- package/lib/front_end/core/sdk/DebuggerModel.ts +1605 -0
- package/lib/front_end/core/sdk/EmulationModel.ts +648 -0
- package/lib/front_end/core/sdk/EnhancedTracesParser.ts +515 -0
- package/lib/front_end/core/sdk/EventBreakpointsModel.ts +183 -0
- package/lib/front_end/core/sdk/FrameAssociated.ts +11 -0
- package/lib/front_end/core/sdk/FrameManager.ts +259 -0
- package/lib/front_end/core/sdk/HeapProfilerModel.ts +225 -0
- package/lib/front_end/core/sdk/HttpReasonPhraseStrings.ts +77 -0
- package/lib/front_end/core/sdk/IOModel.ts +91 -0
- package/lib/front_end/core/sdk/IsolateManager.ts +257 -0
- package/lib/front_end/core/sdk/IssuesModel.ts +70 -0
- package/lib/front_end/core/sdk/LayerTreeBase.ts +169 -0
- package/lib/front_end/core/sdk/LogModel.ts +56 -0
- package/lib/front_end/core/sdk/NetworkManager.ts +2823 -0
- package/lib/front_end/core/sdk/NetworkRequest.ts +2253 -0
- package/lib/front_end/core/sdk/OverlayColorGenerator.ts +52 -0
- package/lib/front_end/core/sdk/OverlayModel.ts +1011 -0
- package/lib/front_end/core/sdk/OverlayPersistentHighlighter.ts +522 -0
- package/lib/front_end/core/sdk/PageLoad.ts +35 -0
- package/lib/front_end/core/sdk/PageResourceLoader.ts +435 -0
- package/lib/front_end/core/sdk/PaintProfiler.ts +110 -0
- package/lib/front_end/core/sdk/PerformanceMetricsModel.ts +84 -0
- package/lib/front_end/core/sdk/PreloadingModel.ts +863 -0
- package/lib/front_end/core/sdk/RehydratingConnection.ts +386 -0
- package/lib/front_end/core/sdk/RehydratingObject.ts +66 -0
- package/lib/front_end/core/sdk/RemoteObject.ts +1160 -0
- package/lib/front_end/core/sdk/Resource.ts +232 -0
- package/lib/front_end/core/sdk/ResourceTreeModel.ts +1160 -0
- package/lib/front_end/core/sdk/RuntimeModel.ts +732 -0
- package/lib/front_end/core/sdk/SDKModel.ts +65 -0
- package/lib/front_end/core/sdk/ScopeTreeCache.ts +45 -0
- package/lib/front_end/core/sdk/ScreenCaptureModel.ts +255 -0
- package/lib/front_end/core/sdk/Script.ts +534 -0
- package/lib/front_end/core/sdk/SecurityOriginManager.ts +76 -0
- package/lib/front_end/core/sdk/ServerSentEvents.ts +80 -0
- package/lib/front_end/core/sdk/ServerSentEventsProtocol.ts +122 -0
- package/lib/front_end/core/sdk/ServerTiming.ts +260 -0
- package/lib/front_end/core/sdk/ServiceWorkerCacheModel.ts +377 -0
- package/lib/front_end/core/sdk/ServiceWorkerManager.ts +605 -0
- package/lib/front_end/core/sdk/SourceMap.ts +867 -0
- package/lib/front_end/core/sdk/SourceMapCache.ts +54 -0
- package/lib/front_end/core/sdk/SourceMapFunctionRanges.ts +156 -0
- package/lib/front_end/core/sdk/SourceMapManager.ts +239 -0
- package/lib/front_end/core/sdk/SourceMapScopeChainEntry.ts +189 -0
- package/lib/front_end/core/sdk/SourceMapScopesInfo.ts +508 -0
- package/lib/front_end/core/sdk/StorageBucketsModel.ts +204 -0
- package/lib/front_end/core/sdk/StorageKeyManager.ts +98 -0
- package/lib/front_end/core/sdk/Target.ts +332 -0
- package/lib/front_end/core/sdk/TargetManager.ts +453 -0
- package/lib/front_end/core/sdk/TraceObject.ts +61 -0
- package/lib/front_end/core/sdk/WebAuthnModel.ts +104 -0
- package/lib/front_end/core/sdk/sdk.ts +174 -0
- package/lib/front_end/entrypoints/formatter_worker/FormatterActions.ts +59 -0
- package/lib/front_end/generated/InspectorBackendCommands.js +1617 -0
- package/lib/front_end/generated/SupportedCSSProperties.js +7512 -0
- package/lib/front_end/generated/protocol-proxy-api.d.ts +5022 -0
- package/lib/front_end/generated/protocol.ts +22014 -0
- package/lib/front_end/models/cpu_profile/CPUProfileDataModel.ts +571 -0
- package/lib/front_end/models/cpu_profile/ProfileTreeModel.ts +103 -0
- package/lib/front_end/models/cpu_profile/cpu_profile.ts +11 -0
- package/lib/front_end/models/formatter/FormatterWorkerPool.ts +219 -0
- package/lib/front_end/models/formatter/ScriptFormatter.ts +112 -0
- package/lib/front_end/models/formatter/formatter.ts +8 -0
- package/lib/front_end/models/text_utils/CodeMirrorUtils.ts +37 -0
- package/lib/front_end/models/text_utils/ContentData.ts +199 -0
- package/lib/front_end/models/text_utils/ContentProvider.ts +68 -0
- package/lib/front_end/models/text_utils/StaticContentProvider.ts +49 -0
- package/lib/front_end/models/text_utils/StreamingContentData.ts +108 -0
- package/lib/front_end/models/text_utils/Text.ts +90 -0
- package/lib/front_end/models/text_utils/TextCursor.ts +44 -0
- package/lib/front_end/models/text_utils/TextRange.ts +266 -0
- package/lib/front_end/models/text_utils/TextUtils.ts +401 -0
- package/lib/front_end/models/text_utils/WasmDisassembly.ts +87 -0
- package/lib/front_end/models/text_utils/text_utils.ts +27 -0
- package/lib/front_end/models/trace/EntityMapper.ts +141 -0
- package/lib/front_end/models/trace/EventsSerializer.ts +101 -0
- package/lib/front_end/models/trace/LanternComputationData.ts +438 -0
- package/lib/front_end/models/trace/ModelImpl.ts +236 -0
- package/lib/front_end/models/trace/Name.ts +136 -0
- package/lib/front_end/models/trace/Processor.ts +652 -0
- package/lib/front_end/models/trace/Styles.ts +1138 -0
- package/lib/front_end/models/trace/extras/FilmStrip.ts +78 -0
- package/lib/front_end/models/trace/extras/MainThreadActivity.ts +86 -0
- package/lib/front_end/models/trace/extras/ScriptDuplication.ts +236 -0
- package/lib/front_end/models/trace/extras/StackTraceForEvent.ts +203 -0
- package/lib/front_end/models/trace/extras/ThirdParties.ts +164 -0
- package/lib/front_end/models/trace/extras/TraceFilter.ts +62 -0
- package/lib/front_end/models/trace/extras/TraceTree.ts +701 -0
- package/lib/front_end/models/trace/extras/extras.ts +11 -0
- package/lib/front_end/models/trace/handlers/AnimationFramesHandler.ts +128 -0
- package/lib/front_end/models/trace/handlers/AnimationHandler.ts +36 -0
- package/lib/front_end/models/trace/handlers/AsyncJSCallsHandler.ts +239 -0
- package/lib/front_end/models/trace/handlers/AuctionWorkletsHandler.ts +183 -0
- package/lib/front_end/models/trace/handlers/DOMStatsHandler.ts +31 -0
- package/lib/front_end/models/trace/handlers/ExtensionTraceDataHandler.ts +306 -0
- package/lib/front_end/models/trace/handlers/FlowsHandler.ts +175 -0
- package/lib/front_end/models/trace/handlers/FramesHandler.ts +571 -0
- package/lib/front_end/models/trace/handlers/GPUHandler.ts +50 -0
- package/lib/front_end/models/trace/handlers/ImagePaintingHandler.ts +183 -0
- package/lib/front_end/models/trace/handlers/InitiatorsHandler.ts +193 -0
- package/lib/front_end/models/trace/handlers/InvalidationsHandler.ts +168 -0
- package/lib/front_end/models/trace/handlers/LargestImagePaintHandler.ts +109 -0
- package/lib/front_end/models/trace/handlers/LargestTextPaintHandler.ts +35 -0
- package/lib/front_end/models/trace/handlers/LayerTreeHandler.ts +123 -0
- package/lib/front_end/models/trace/handlers/LayoutShiftsHandler.ts +573 -0
- package/lib/front_end/models/trace/handlers/MemoryHandler.ts +31 -0
- package/lib/front_end/models/trace/handlers/MetaHandler.ts +525 -0
- package/lib/front_end/models/trace/handlers/ModelHandlers.ts +34 -0
- package/lib/front_end/models/trace/handlers/NetworkRequestsHandler.ts +672 -0
- package/lib/front_end/models/trace/handlers/PageFramesHandler.ts +52 -0
- package/lib/front_end/models/trace/handlers/PageLoadMetricsHandler.ts +460 -0
- package/lib/front_end/models/trace/handlers/RendererHandler.ts +428 -0
- package/lib/front_end/models/trace/handlers/SamplesHandler.ts +271 -0
- package/lib/front_end/models/trace/handlers/ScreenshotsHandler.ts +122 -0
- package/lib/front_end/models/trace/handlers/ScriptsHandler.ts +336 -0
- package/lib/front_end/models/trace/handlers/SelectorStatsHandler.ts +110 -0
- package/lib/front_end/models/trace/handlers/Threads.ts +139 -0
- package/lib/front_end/models/trace/handlers/UserInteractionsHandler.ts +400 -0
- package/lib/front_end/models/trace/handlers/UserTimingsHandler.ts +233 -0
- package/lib/front_end/models/trace/handlers/WarningsHandler.ts +162 -0
- package/lib/front_end/models/trace/handlers/WorkersHandler.ts +45 -0
- package/lib/front_end/models/trace/handlers/handlers.ts +8 -0
- package/lib/front_end/models/trace/handlers/helpers.ts +196 -0
- package/lib/front_end/models/trace/handlers/types.ts +75 -0
- package/lib/front_end/models/trace/helpers/Extensions.ts +54 -0
- package/lib/front_end/models/trace/helpers/Network.ts +129 -0
- package/lib/front_end/models/trace/helpers/SamplesIntegrator.ts +544 -0
- package/lib/front_end/models/trace/helpers/SyntheticEvents.ts +87 -0
- package/lib/front_end/models/trace/helpers/Timing.ts +248 -0
- package/lib/front_end/models/trace/helpers/Trace.ts +928 -0
- package/lib/front_end/models/trace/helpers/TreeHelpers.ts +320 -0
- package/lib/front_end/models/trace/helpers/helpers.ts +11 -0
- package/lib/front_end/models/trace/insights/CLSCulprits.ts +668 -0
- package/lib/front_end/models/trace/insights/Cache.ts +269 -0
- package/lib/front_end/models/trace/insights/Common.ts +453 -0
- package/lib/front_end/models/trace/insights/DOMSize.ts +223 -0
- package/lib/front_end/models/trace/insights/DocumentLatency.ts +319 -0
- package/lib/front_end/models/trace/insights/DuplicatedJavaScript.ts +126 -0
- package/lib/front_end/models/trace/insights/FontDisplay.ts +119 -0
- package/lib/front_end/models/trace/insights/ForcedReflow.ts +220 -0
- package/lib/front_end/models/trace/insights/INPBreakdown.ts +171 -0
- package/lib/front_end/models/trace/insights/ImageDelivery.ts +348 -0
- package/lib/front_end/models/trace/insights/LCPBreakdown.ts +268 -0
- package/lib/front_end/models/trace/insights/LCPDiscovery.ts +237 -0
- package/lib/front_end/models/trace/insights/LegacyJavaScript.ts +138 -0
- package/lib/front_end/models/trace/insights/Models.ts +22 -0
- package/lib/front_end/models/trace/insights/ModernHTTP.ts +257 -0
- package/lib/front_end/models/trace/insights/NetworkDependencyTree.ts +726 -0
- package/lib/front_end/models/trace/insights/RenderBlocking.ts +257 -0
- package/lib/front_end/models/trace/insights/SlowCSSSelector.ts +175 -0
- package/lib/front_end/models/trace/insights/Statistics.ts +101 -0
- package/lib/front_end/models/trace/insights/ThirdParties.ts +130 -0
- package/lib/front_end/models/trace/insights/Viewport.ts +138 -0
- package/lib/front_end/models/trace/insights/insights.ts +10 -0
- package/lib/front_end/models/trace/insights/types.ts +157 -0
- package/lib/front_end/models/trace/lantern/core/LanternError.ts +7 -0
- package/lib/front_end/models/trace/lantern/core/NetworkAnalyzer.ts +619 -0
- package/lib/front_end/models/trace/lantern/core/core.ts +6 -0
- package/lib/front_end/models/trace/lantern/graph/BaseNode.ts +345 -0
- package/lib/front_end/models/trace/lantern/graph/CPUNode.ts +80 -0
- package/lib/front_end/models/trace/lantern/graph/NetworkNode.ts +101 -0
- package/lib/front_end/models/trace/lantern/graph/PageDependencyGraph.ts +636 -0
- package/lib/front_end/models/trace/lantern/graph/graph.ts +8 -0
- package/lib/front_end/models/trace/lantern/lantern.ts +17 -0
- package/lib/front_end/models/trace/lantern/metrics/FirstContentfulPaint.ts +187 -0
- package/lib/front_end/models/trace/lantern/metrics/Interactive.ts +88 -0
- package/lib/front_end/models/trace/lantern/metrics/LargestContentfulPaint.ts +92 -0
- package/lib/front_end/models/trace/lantern/metrics/MaxPotentialFID.ts +72 -0
- package/lib/front_end/models/trace/lantern/metrics/Metric.ts +126 -0
- package/lib/front_end/models/trace/lantern/metrics/SpeedIndex.ts +126 -0
- package/lib/front_end/models/trace/lantern/metrics/TBTUtils.ts +82 -0
- package/lib/front_end/models/trace/lantern/metrics/TotalBlockingTime.ts +112 -0
- package/lib/front_end/models/trace/lantern/metrics/metrics.ts +12 -0
- package/lib/front_end/models/trace/lantern/simulation/ConnectionPool.ts +150 -0
- package/lib/front_end/models/trace/lantern/simulation/Constants.ts +46 -0
- package/lib/front_end/models/trace/lantern/simulation/DNSCache.ts +61 -0
- package/lib/front_end/models/trace/lantern/simulation/SimulationTimingMap.ts +196 -0
- package/lib/front_end/models/trace/lantern/simulation/Simulator.ts +556 -0
- package/lib/front_end/models/trace/lantern/simulation/TCPConnection.ts +192 -0
- package/lib/front_end/models/trace/lantern/simulation/simulation.ts +10 -0
- package/lib/front_end/models/trace/lantern/types/Lantern.ts +220 -0
- package/lib/front_end/models/trace/lantern/types/types.ts +5 -0
- package/lib/front_end/models/trace/trace.ts +33 -0
- package/lib/front_end/models/trace/types/Configuration.ts +110 -0
- package/lib/front_end/models/trace/types/Extensions.ts +136 -0
- package/lib/front_end/models/trace/types/File.ts +281 -0
- package/lib/front_end/models/trace/types/Overlays.ts +138 -0
- package/lib/front_end/models/trace/types/Timing.ts +30 -0
- package/lib/front_end/models/trace/types/TraceEvents.ts +3277 -0
- package/lib/front_end/models/trace/types/types.ts +10 -0
- package/lib/front_end/third_party/i18n/LICENSE +202 -0
- package/lib/front_end/third_party/i18n/README.chromium +15 -0
- package/lib/front_end/third_party/i18n/i18n-impl.ts +61 -0
- package/lib/front_end/third_party/i18n/i18n.ts +11 -0
- package/lib/front_end/third_party/i18n/localized-string-set.ts +129 -0
- package/lib/front_end/third_party/intl-messageformat/LICENSE +33 -0
- package/lib/front_end/third_party/intl-messageformat/README.chromium +24 -0
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat-tsconfig.json +16 -0
- package/lib/front_end/third_party/intl-messageformat/intl-messageformat.ts +6 -0
- package/lib/front_end/third_party/intl-messageformat/package/LICENSE.md +33 -0
- package/lib/front_end/third_party/intl-messageformat/package/README.md +3 -0
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts +6 -0
- package/lib/front_end/third_party/intl-messageformat/package/index.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/index.js +13 -0
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.d.ts +5 -0
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.esm.js +1710 -0
- package/lib/front_end/third_party/intl-messageformat/package/intl-messageformat.iife.js +1815 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts +6 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/index.js +10 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/core.js +229 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts +28 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/error.js +48 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/lib/src/formatters.js +179 -0
- package/lib/front_end/third_party/intl-messageformat/package/package.json +42 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/core.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/core.js +230 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts +28 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/error.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/error.js +51 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts +34 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.d.ts.map +1 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/formatters.js +182 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/error.d.ts +79 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/index.d.ts +15 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/parser.d.ts +153 -0
- package/lib/front_end/third_party/intl-messageformat/package/src/icu-messageformat-parser/types.d.ts +139 -0
- package/lib/front_end/third_party/legacy-javascript/LICENSE +202 -0
- package/lib/front_end/third_party/legacy-javascript/README.chromium +13 -0
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript-tsconfig.json +8 -0
- package/lib/front_end/third_party/legacy-javascript/legacy-javascript.ts +3 -0
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.d.ts +18 -0
- package/lib/front_end/third_party/legacy-javascript/lib/legacy-javascript.js +943 -0
- package/lib/front_end/third_party/legacy-javascript/package.json +8 -0
- package/lib/front_end/third_party/legacy-javascript/rebuild.sh +9 -0
- package/lib/front_end/third_party/third-party-web/LICENSE +20 -0
- package/lib/front_end/third_party/third-party-web/README.chromium +13 -0
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.d.ts +2 -0
- package/lib/front_end/third_party/third-party-web/lib/nostats-subset.js +149 -0
- package/lib/front_end/third_party/third-party-web/package/LICENSE +20 -0
- package/lib/front_end/third_party/third-party-web/package/README.md +929 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities-nostats.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/dist/entities.json +1 -0
- package/lib/front_end/third_party/third-party-web/package/facades.md +46 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-nostats-subset.js +1 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/httparchive-subset.js +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/__snapshots__/index.test.js.snap +1006 -0
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +139 -0
- package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +44 -0
- package/lib/front_end/third_party/third-party-web/package/lib/entities.test.js +27 -0
- package/lib/front_end/third_party/third-party-web/package/lib/index.d.ts +34 -0
- package/lib/front_end/third_party/third-party-web/package/lib/index.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/index.test.js +246 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/faqs.partial.md +36 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/goals.partial.md +9 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/methodology.partial.md +5 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/template.md +151 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-02-01.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-03-01.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-06.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2019-05-13.md +14 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2021-01-01.md +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/markdown/updates/2024-07-01.md +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive-nostats.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/httparchive.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/lib/subsets/nostats.js +3 -0
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.d.ts +1 -0
- package/lib/front_end/third_party/third-party-web/package/nostats-subset.js +1 -0
- package/lib/front_end/third_party/third-party-web/package/package.json +46 -0
- package/lib/front_end/third_party/third-party-web/package.json +8 -0
- package/lib/front_end/third_party/third-party-web/rebuild.sh +13 -0
- package/lib/front_end/third_party/third-party-web/third-party-web-tsconfig.json +8 -0
- package/lib/front_end/third_party/third-party-web/third-party-web.ts +3 -0
- package/package.json +24 -0
- package/patches/chrome-devtools-frontend+1.0.1533544.patch +187 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
const DOMAIN_IN_URL_REGEX = /:\/\/(\S*?)(:\d+)?(\/|$)/
|
|
2
|
+
const DOMAIN_CHARACTERS = /([a-z0-9.-]+\.[a-z0-9]+|localhost)/i
|
|
3
|
+
const IP_REGEX = /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/
|
|
4
|
+
const ROOT_DOMAIN_REGEX = /[^.]+\.([^.]+|(gov|com|co|ne)\.\w{2})$/i
|
|
5
|
+
|
|
6
|
+
function getDomainFromOriginOrURL(originOrURL) {
|
|
7
|
+
if (typeof originOrURL !== 'string') return null
|
|
8
|
+
if (originOrURL.length > 10000 || originOrURL.startsWith('data:')) return null
|
|
9
|
+
if (DOMAIN_IN_URL_REGEX.test(originOrURL)) return originOrURL.match(DOMAIN_IN_URL_REGEX)[1]
|
|
10
|
+
if (DOMAIN_CHARACTERS.test(originOrURL)) return originOrURL.match(DOMAIN_CHARACTERS)[0]
|
|
11
|
+
return null
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function getRootDomain(originOrURL) {
|
|
15
|
+
const domain = getDomainFromOriginOrURL(originOrURL)
|
|
16
|
+
if (!domain) return null
|
|
17
|
+
if (IP_REGEX.test(domain)) return domain
|
|
18
|
+
const match = domain.match(ROOT_DOMAIN_REGEX)
|
|
19
|
+
return (match && match[0]) || domain
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function sliceSubdomainFromDomain(domain, rootDomain) {
|
|
23
|
+
if (domain.length <= rootDomain.length) return domain
|
|
24
|
+
return domain
|
|
25
|
+
.split('.')
|
|
26
|
+
.slice(1)
|
|
27
|
+
.join('.')
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function getEntityInDataset(entityByDomain, entityBySubDomain, entityByRootDomain, originOrURL) {
|
|
31
|
+
const domain = getDomainFromOriginOrURL(originOrURL)
|
|
32
|
+
const rootDomain = getRootDomain(domain)
|
|
33
|
+
if (!domain || !rootDomain) return undefined
|
|
34
|
+
if (entityByDomain.has(domain)) return entityByDomain.get(domain)
|
|
35
|
+
|
|
36
|
+
for (
|
|
37
|
+
let subdomain = domain;
|
|
38
|
+
subdomain.length > rootDomain.length;
|
|
39
|
+
subdomain = sliceSubdomainFromDomain(subdomain, rootDomain)
|
|
40
|
+
) {
|
|
41
|
+
if (entityBySubDomain.has(subdomain)) return entityBySubDomain.get(subdomain)
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (entityByRootDomain.has(rootDomain)) return entityByRootDomain.get(rootDomain)
|
|
45
|
+
return undefined
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function getProductInDataset(entityByDomain, entityBySubDomain, entityByRootDomain, originOrURL) {
|
|
49
|
+
const entity = getEntityInDataset(
|
|
50
|
+
entityByDomain,
|
|
51
|
+
entityBySubDomain,
|
|
52
|
+
entityByRootDomain,
|
|
53
|
+
originOrURL
|
|
54
|
+
)
|
|
55
|
+
const products = entity && entity.products
|
|
56
|
+
if (!products) return undefined
|
|
57
|
+
if (typeof originOrURL !== 'string') return undefined
|
|
58
|
+
|
|
59
|
+
for (const product of products) {
|
|
60
|
+
for (const pattern of product.urlPatterns) {
|
|
61
|
+
if (pattern instanceof RegExp && pattern.test(originOrURL)) return product
|
|
62
|
+
if (typeof pattern === 'string' && originOrURL.includes(pattern)) return product
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return undefined
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function cloneEntities(entities) {
|
|
69
|
+
return entities.map(entity_ => {
|
|
70
|
+
const entity = {
|
|
71
|
+
company: entity_.name,
|
|
72
|
+
categories: [entity_.category],
|
|
73
|
+
...entity_,
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const products = (entity_.products || []).map(product => ({
|
|
77
|
+
company: entity.company,
|
|
78
|
+
category: entity.category,
|
|
79
|
+
categories: [entity.category],
|
|
80
|
+
facades: [],
|
|
81
|
+
...product,
|
|
82
|
+
urlPatterns: (product.urlPatterns || []).map(s =>
|
|
83
|
+
s.startsWith('REGEXP:') ? new RegExp(s.slice('REGEXP:'.length)) : s
|
|
84
|
+
),
|
|
85
|
+
}))
|
|
86
|
+
|
|
87
|
+
entity.products = products
|
|
88
|
+
return entity
|
|
89
|
+
})
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function createAPIFromDataset(entities_) {
|
|
93
|
+
const entities = cloneEntities(entities_)
|
|
94
|
+
const entityByDomain = new Map()
|
|
95
|
+
const entityByRootDomain = new Map()
|
|
96
|
+
const entityBySubDomain = new Map()
|
|
97
|
+
|
|
98
|
+
for (const entity of entities) {
|
|
99
|
+
entity.totalExecutionTime = Number(entity.totalExecutionTime) || 0
|
|
100
|
+
entity.totalOccurrences = Number(entity.totalOccurrences) || 0
|
|
101
|
+
entity.averageExecutionTime = entity.totalExecutionTime / entity.totalOccurrences
|
|
102
|
+
|
|
103
|
+
for (const domain of entity.domains) {
|
|
104
|
+
if (entityByDomain.has(domain)) {
|
|
105
|
+
const duplicate = entityByDomain.get(domain)
|
|
106
|
+
throw new Error(`Duplicate domain ${domain} (${entity.name} and ${duplicate.name})`)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
entityByDomain.set(domain, entity)
|
|
110
|
+
|
|
111
|
+
const rootDomain = getRootDomain(domain)
|
|
112
|
+
if (domain.startsWith('*.')) {
|
|
113
|
+
const wildcardDomain = domain.slice(2)
|
|
114
|
+
if (wildcardDomain === rootDomain) entityByRootDomain.set(rootDomain, entity)
|
|
115
|
+
else entityBySubDomain.set(wildcardDomain, entity)
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
for (const [rootDomain, entity] of entityByRootDomain.entries()) {
|
|
121
|
+
if (!entity) entityByRootDomain.delete(rootDomain)
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const getEntity = getEntityInDataset.bind(
|
|
125
|
+
null,
|
|
126
|
+
entityByDomain,
|
|
127
|
+
entityBySubDomain,
|
|
128
|
+
entityByRootDomain
|
|
129
|
+
)
|
|
130
|
+
const getProduct = getProductInDataset.bind(
|
|
131
|
+
null,
|
|
132
|
+
entityByDomain,
|
|
133
|
+
entityBySubDomain,
|
|
134
|
+
entityByRootDomain
|
|
135
|
+
)
|
|
136
|
+
return {getEntity, getProduct, getRootDomain, entities}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
module.exports = {createAPIFromDataset}
|
package/lib/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
const {createAPIFromDataset} = require('./create-entity-finder-api.js')
|
|
2
|
+
|
|
3
|
+
describe('getEntity', () => {
|
|
4
|
+
let api
|
|
5
|
+
|
|
6
|
+
beforeEach(() => {
|
|
7
|
+
api = createAPIFromDataset([
|
|
8
|
+
{
|
|
9
|
+
name: 'Domain',
|
|
10
|
+
domains: ['*.example.com', '*.example.co.uk'],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
name: 'Subdomain',
|
|
14
|
+
domains: ['*.sub.example.com', '*.sub.example.co.uk'],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
name: 'Subsubdomain',
|
|
18
|
+
domains: ['very.specific.example.com'],
|
|
19
|
+
},
|
|
20
|
+
])
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
it('should find direct domains', () => {
|
|
24
|
+
expect(api.getEntity('https://very.specific.example.com/path').name).toEqual('Subsubdomain')
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
it('should find wildcard subdomains', () => {
|
|
28
|
+
expect(api.getEntity('https://foo.sub.example.com/path').name).toEqual('Subdomain')
|
|
29
|
+
expect(api.getEntity('https://bar.sub.example.com/path').name).toEqual('Subdomain')
|
|
30
|
+
expect(api.getEntity('https://baz.bar.sub.example.com/path').name).toEqual('Subdomain')
|
|
31
|
+
expect(api.getEntity('https://foo.sub.example.co.uk/path').name).toEqual('Subdomain')
|
|
32
|
+
expect(api.getEntity('https://bar.sub.example.co.uk/path').name).toEqual('Subdomain')
|
|
33
|
+
expect(api.getEntity('https://baz.bar.sub.example.co.uk/path').name).toEqual('Subdomain')
|
|
34
|
+
})
|
|
35
|
+
|
|
36
|
+
it('should find wildcard domains', () => {
|
|
37
|
+
expect(api.getEntity('https://foo.example.com/path').name).toEqual('Domain')
|
|
38
|
+
expect(api.getEntity('https://bar.example.com/path').name).toEqual('Domain')
|
|
39
|
+
expect(api.getEntity('https://baz.bar.example.com/path').name).toEqual('Domain')
|
|
40
|
+
expect(api.getEntity('https://foo.example.co.uk/path').name).toEqual('Domain')
|
|
41
|
+
expect(api.getEntity('https://bar.example.co.uk/path').name).toEqual('Domain')
|
|
42
|
+
expect(api.getEntity('https://baz.bar.example.co.uk/path').name).toEqual('Domain')
|
|
43
|
+
})
|
|
44
|
+
})
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
const _ = require('lodash')
|
|
2
|
+
const {entities, getRootDomain, getEntity} = require('./index.js')
|
|
3
|
+
|
|
4
|
+
describe('Entities', () => {
|
|
5
|
+
it('should not have duplicate names', () => {
|
|
6
|
+
for (let i = 0; i < entities.length; i++) {
|
|
7
|
+
for (let j = i + 1; j < entities.length; j++) {
|
|
8
|
+
const nameA = entities[i].name.replace(/\s+/, '').toLowerCase()
|
|
9
|
+
const nameB = entities[j].name.replace(/\s+/, '').toLowerCase()
|
|
10
|
+
if (nameA !== nameB) continue
|
|
11
|
+
|
|
12
|
+
expect(entities[i]).toBe(entities[j])
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it('should not have non-supported wilcards', () => {
|
|
18
|
+
for (const entity of entities) {
|
|
19
|
+
for (const domain of entity.domains) {
|
|
20
|
+
// Wildcards must be like `*.blah.com`
|
|
21
|
+
// Wildcards cannot be `*blah.com` or `blah*.com`
|
|
22
|
+
expect(domain).toEqual(expect.not.stringMatching(/\w\*/))
|
|
23
|
+
expect(domain).toEqual(expect.not.stringMatching(/\*\w/))
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
})
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export interface IFacade {
|
|
2
|
+
name: string
|
|
3
|
+
repo: string
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
export interface IProduct {
|
|
7
|
+
name: string
|
|
8
|
+
company: string
|
|
9
|
+
homepage?: string
|
|
10
|
+
category: string
|
|
11
|
+
/** @deprecated - Use `category` instead. */
|
|
12
|
+
categories: string[]
|
|
13
|
+
urlPatterns?: string[]
|
|
14
|
+
facades?: IFacade[]
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface IEntity {
|
|
18
|
+
name: string
|
|
19
|
+
company: string
|
|
20
|
+
homepage?: string
|
|
21
|
+
category: string
|
|
22
|
+
/** @deprecated - Use `category` instead. */
|
|
23
|
+
categories: string[]
|
|
24
|
+
domains: string[]
|
|
25
|
+
products?: IProduct[]
|
|
26
|
+
averageExecutionTime: number
|
|
27
|
+
totalExecutionTime: number
|
|
28
|
+
totalOccurrences: number
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export declare const entities: IEntity[]
|
|
32
|
+
export declare function getRootDomain(url: string): string
|
|
33
|
+
export declare function getEntity(url: string): IEntity | undefined
|
|
34
|
+
export declare function getProduct(url: string): IProduct | undefined
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
const fs = require('fs')
|
|
2
|
+
const path = require('path')
|
|
3
|
+
const {entities, getRootDomain, getEntity, getProduct} = require('./index.js')
|
|
4
|
+
|
|
5
|
+
describe('getRootDomain', () => {
|
|
6
|
+
it('works for IP addresses', () => {
|
|
7
|
+
expect(getRootDomain('8.8.8.8')).toEqual('8.8.8.8')
|
|
8
|
+
expect(getRootDomain('192.168.0.1')).toEqual('192.168.0.1')
|
|
9
|
+
})
|
|
10
|
+
|
|
11
|
+
it('works for basic domains', () => {
|
|
12
|
+
expect(getRootDomain('cdn.cnn.com')).toEqual('cnn.com')
|
|
13
|
+
expect(getRootDomain('www.hulce.photography')).toEqual('hulce.photography')
|
|
14
|
+
expect(getRootDomain('api.supercool.io')).toEqual('supercool.io')
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
it('works for country-tlds', () => {
|
|
18
|
+
expect(getRootDomain('content.yahoo.co.jp')).toEqual('yahoo.co.jp')
|
|
19
|
+
expect(getRootDomain('go.visit.gov.in')).toEqual('visit.gov.in')
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
it('works for URLs', () => {
|
|
23
|
+
expect(getRootDomain('https://content.yahoo.co.jp/path/?query=param')).toEqual('yahoo.co.jp')
|
|
24
|
+
expect(getRootDomain('https://a.b.c.it/path/?query=param&two=2')).toEqual('c.it')
|
|
25
|
+
expect(getRootDomain('https://foo.bar:433/path/?query=param&two=2')).toEqual('foo.bar')
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('works for localhost', () => {
|
|
29
|
+
expect(getRootDomain('https://localhost:8080/path/?query=param')).toEqual('localhost')
|
|
30
|
+
expect(getRootDomain('https://localhost/path/?query=param&two=2')).toEqual('localhost')
|
|
31
|
+
expect(getRootDomain('localhost:9000/path/?query=param&two=2')).toEqual('localhost')
|
|
32
|
+
expect(getRootDomain('localhost:1200')).toEqual('localhost')
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
it('works for wildcard domains', () => {
|
|
36
|
+
expect(getRootDomain('*.google.com')).toEqual('google.com')
|
|
37
|
+
expect(getRootDomain('*.yahoo.co.jp')).toEqual('yahoo.co.jp')
|
|
38
|
+
expect(getRootDomain('*.hulce.photography')).toEqual('hulce.photography')
|
|
39
|
+
})
|
|
40
|
+
|
|
41
|
+
it('runs on *massive* inputs', () => {
|
|
42
|
+
const massiveInput = '123456789'.repeat(100e3)
|
|
43
|
+
expect(getRootDomain(massiveInput)).toEqual(null)
|
|
44
|
+
})
|
|
45
|
+
|
|
46
|
+
it('runs on data URIs', () => {
|
|
47
|
+
const dataUri = 'data:image/gif;base64,R0lGODlhAQABAIAAAP8AADAAACwAAAAAAQABAAACAkQBADs='
|
|
48
|
+
expect(getRootDomain(dataUri)).toEqual(null)
|
|
49
|
+
})
|
|
50
|
+
|
|
51
|
+
it('returns null on invalid inputs', () => {
|
|
52
|
+
expect(getRootDomain('this is not a domain')).toEqual(null)
|
|
53
|
+
expect(getRootDomain('neither-is-this')).toEqual(null)
|
|
54
|
+
expect(getRootDomain('http://nor this')).toEqual(null)
|
|
55
|
+
})
|
|
56
|
+
})
|
|
57
|
+
|
|
58
|
+
describe('getEntity', () => {
|
|
59
|
+
it('works for direct domain usage', () => {
|
|
60
|
+
expect(getEntity('https://js.connect.facebook.net/lib.js')).toMatchInlineSnapshot(`
|
|
61
|
+
Object {
|
|
62
|
+
"averageExecutionTime": 347.4278160199557,
|
|
63
|
+
"categories": Array [
|
|
64
|
+
"social",
|
|
65
|
+
],
|
|
66
|
+
"category": "social",
|
|
67
|
+
"company": "Facebook",
|
|
68
|
+
"domains": Array [
|
|
69
|
+
"*.facebook.com",
|
|
70
|
+
"*.atlassbx.com",
|
|
71
|
+
"*.fbsbx.com",
|
|
72
|
+
"fbcdn-photos-e-a.akamaihd.net",
|
|
73
|
+
"*.facebook.net",
|
|
74
|
+
"*.fbcdn.net",
|
|
75
|
+
],
|
|
76
|
+
"examples": Array [
|
|
77
|
+
"www.facebook.com",
|
|
78
|
+
"connect.facebook.net",
|
|
79
|
+
"staticxx.facebook.com",
|
|
80
|
+
"static.xx.fbcdn.net",
|
|
81
|
+
"m.facebook.com",
|
|
82
|
+
"an.facebook.com",
|
|
83
|
+
"platform-lookaside.fbsbx.com",
|
|
84
|
+
],
|
|
85
|
+
"homepage": "https://www.facebook.com",
|
|
86
|
+
"name": "Facebook",
|
|
87
|
+
"products": Array [
|
|
88
|
+
Object {
|
|
89
|
+
"categories": Array [
|
|
90
|
+
"social",
|
|
91
|
+
],
|
|
92
|
+
"category": "social",
|
|
93
|
+
"company": "Facebook",
|
|
94
|
+
"facades": Array [
|
|
95
|
+
Object {
|
|
96
|
+
"name": "React Live Chat Loader",
|
|
97
|
+
"repo": "https://github.com/calibreapp/react-live-chat-loader",
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
"name": "Facebook Messenger Customer Chat",
|
|
101
|
+
"urlPatterns": Array [
|
|
102
|
+
/connect\\\\\\.facebook\\\\\\.net\\\\/\\.\\*\\\\/sdk\\\\/xfbml\\\\\\.customerchat\\\\\\.js/,
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
"totalExecutionTime": 1097107210,
|
|
107
|
+
"totalOccurrences": 3157799,
|
|
108
|
+
}
|
|
109
|
+
`)
|
|
110
|
+
})
|
|
111
|
+
|
|
112
|
+
it('works for inferred domain usage', () => {
|
|
113
|
+
expect(getEntity('https://unknown.typekit.net/fonts.css')).toMatchInlineSnapshot(`
|
|
114
|
+
Object {
|
|
115
|
+
"averageExecutionTime": 660.2645605704683,
|
|
116
|
+
"categories": Array [
|
|
117
|
+
"cdn",
|
|
118
|
+
],
|
|
119
|
+
"category": "cdn",
|
|
120
|
+
"company": "Adobe",
|
|
121
|
+
"domains": Array [
|
|
122
|
+
"*.typekit.com",
|
|
123
|
+
"*.typekit.net",
|
|
124
|
+
],
|
|
125
|
+
"examples": Array [
|
|
126
|
+
"use.typekit.net",
|
|
127
|
+
"p.typekit.net",
|
|
128
|
+
],
|
|
129
|
+
"homepage": "https://fonts.adobe.com/",
|
|
130
|
+
"name": "Adobe TypeKit",
|
|
131
|
+
"products": Array [],
|
|
132
|
+
"totalExecutionTime": 78981507,
|
|
133
|
+
"totalOccurrences": 119621,
|
|
134
|
+
}
|
|
135
|
+
`)
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
it('does not over-infer', () => {
|
|
139
|
+
expect(getEntity('https://unknown.gstatic.com/what')).toEqual(undefined)
|
|
140
|
+
})
|
|
141
|
+
|
|
142
|
+
it('only infers as a fallback', () => {
|
|
143
|
+
expect(getEntity('http://fbcdn-photos-e-a.akamaihd.net/1234.jpg').name).toEqual('Facebook')
|
|
144
|
+
expect(getEntity('http://unknown.akamaihd.net/1234.jpg').name).toEqual('Akamai')
|
|
145
|
+
})
|
|
146
|
+
|
|
147
|
+
it('runs on *massive* inputs', () => {
|
|
148
|
+
const massiveInput = '123456789'.repeat(100e3)
|
|
149
|
+
expect(getEntity(massiveInput)).toEqual(undefined)
|
|
150
|
+
})
|
|
151
|
+
|
|
152
|
+
it('runs on data URIs', () => {
|
|
153
|
+
const dataUri = 'data:image/gif;base64,R0lGODlhAQABAIAAAP8AADAAACwAAAAAAQABAAACAkQBADs='
|
|
154
|
+
expect(getEntity(dataUri)).toEqual(undefined)
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
it('supports multi-tennant domains', () => {
|
|
158
|
+
expect(getEntity('https://gemius.mgr.consensu.org/cmp/v2/stub.js').name).toEqual('Gemius CMP')
|
|
159
|
+
expect(
|
|
160
|
+
getEntity('https://quantcast.mgr.consensu.org/choice/KygWsHah2_7Qa/rssing.com/choice.js').name
|
|
161
|
+
).toEqual('Quantcast Choice')
|
|
162
|
+
expect(getEntity('https://static.quantcast.mgr.consensu.org/v50/cmpui-popup.js').name).toEqual(
|
|
163
|
+
'Quantcast Choice'
|
|
164
|
+
)
|
|
165
|
+
})
|
|
166
|
+
})
|
|
167
|
+
|
|
168
|
+
describe('getProduct', () => {
|
|
169
|
+
it('works on basic url', () => {
|
|
170
|
+
expect(getProduct('https://www.youtube.com/embed/alGcULGtiv8')).toMatchObject({
|
|
171
|
+
name: 'YouTube Embedded Player',
|
|
172
|
+
company: 'YouTube',
|
|
173
|
+
category: 'video',
|
|
174
|
+
categories: ['video'],
|
|
175
|
+
facades: [
|
|
176
|
+
{
|
|
177
|
+
name: 'Lite YouTube',
|
|
178
|
+
repo: 'https://github.com/paulirish/lite-youtube-embed',
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: 'Ngx Lite Video',
|
|
182
|
+
repo: 'https://github.com/karim-mamdouh/ngx-lite-video',
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
})
|
|
186
|
+
})
|
|
187
|
+
|
|
188
|
+
it('works on regex based', () => {
|
|
189
|
+
expect(
|
|
190
|
+
getProduct('https://connect.facebook.net/en_US/sdk/xfbml.customerchat.js')
|
|
191
|
+
).toMatchObject({
|
|
192
|
+
name: 'Facebook Messenger Customer Chat',
|
|
193
|
+
facades: [
|
|
194
|
+
{
|
|
195
|
+
name: 'React Live Chat Loader',
|
|
196
|
+
repo: 'https://github.com/calibreapp/react-live-chat-loader',
|
|
197
|
+
},
|
|
198
|
+
],
|
|
199
|
+
})
|
|
200
|
+
})
|
|
201
|
+
|
|
202
|
+
it('returns undefined when product does not match', () => {
|
|
203
|
+
expect(getProduct('https://js.connect.facebook.net/lib.js')).toEqual(undefined)
|
|
204
|
+
})
|
|
205
|
+
|
|
206
|
+
it('returns undefined with no products', () => {
|
|
207
|
+
expect(getProduct('https://unknown.typekit.net/fonts.css')).toEqual(undefined)
|
|
208
|
+
})
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
describe('build state', () => {
|
|
212
|
+
it('should use the complete entities set', () => {
|
|
213
|
+
const sourceOfTruthEntities = require('../data/entities.js')
|
|
214
|
+
expect(entities).toHaveLength(sourceOfTruthEntities.length)
|
|
215
|
+
})
|
|
216
|
+
|
|
217
|
+
it('should have all the same subsets in root as lib', () => {
|
|
218
|
+
const srcSizes = fs.readdirSync(path.join(__dirname, 'subsets'))
|
|
219
|
+
const dstSizes = fs.readdirSync(path.join(__dirname, '../')).filter(f => f.includes('-subset'))
|
|
220
|
+
expect(dstSizes).toHaveLength(srcSizes.length) // run `yarn build` if this fails
|
|
221
|
+
|
|
222
|
+
for (const file of dstSizes) {
|
|
223
|
+
if (file.endsWith('.js')) require(path.join(__dirname, '../', file))
|
|
224
|
+
}
|
|
225
|
+
})
|
|
226
|
+
})
|
|
227
|
+
|
|
228
|
+
it('should work on real web data', () => {
|
|
229
|
+
const urls = fs
|
|
230
|
+
.readFileSync(path.join(__dirname, '../data/random-urls.txt'), 'utf8')
|
|
231
|
+
.split('\n')
|
|
232
|
+
.filter(Boolean)
|
|
233
|
+
|
|
234
|
+
for (const url of urls) {
|
|
235
|
+
getEntity(url) // ensure it doesn't throw
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const top1000 = urls.slice(0, 1000).map(url => {
|
|
239
|
+
const cleanedUrl = url.split('?')[0]
|
|
240
|
+
const entity = getEntity(url)
|
|
241
|
+
return `${entity && entity.name} - ${cleanedUrl}`
|
|
242
|
+
})
|
|
243
|
+
|
|
244
|
+
// It's expected that this snapshot will change as coverage changes.
|
|
245
|
+
expect(top1000).toMatchSnapshot()
|
|
246
|
+
})
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: faqs
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
### I don't see entity X in the list. What's up with that?
|
|
6
|
+
|
|
7
|
+
This can be for one of several reasons:
|
|
8
|
+
|
|
9
|
+
1. The entity does not have references to their origin on at least 50 pages in the dataset.
|
|
10
|
+
1. The entity's origins have not yet been identified. See [How can I contribute?](#contribute)
|
|
11
|
+
|
|
12
|
+
### What is "Total Occurences"?
|
|
13
|
+
|
|
14
|
+
Total Occurrences is the number of pages on which the entity is included.
|
|
15
|
+
|
|
16
|
+
### How is the "Average Impact" determined?
|
|
17
|
+
|
|
18
|
+
The HTTP Archive dataset includes Lighthouse reports for each URL on mobile. Lighthouse has an audit called "bootup-time" that summarizes the amount of time that each script spent on the main thread. The "Average Impact" for an entity is the total execution time of scripts whose domain matches one of the entity's domains divided by the total number of pages that included the entity.
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Average Impact = Total Execution Time / Total Occurrences
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### How does Lighthouse determine the execution time of each script?
|
|
25
|
+
|
|
26
|
+
Lighthouse's bootup time audit attempts to attribute all toplevel main-thread tasks to a URL. A main thread task is attributed to the first script URL found in the stack. If you're interested in helping us improve this logic, see [Contributing](#contributing) for details.
|
|
27
|
+
|
|
28
|
+
### The data for entity X seems wrong. How can it be corrected?
|
|
29
|
+
|
|
30
|
+
Verify that the origins in `data/entities.js` are correct. Most issues will simply be the result of mislabelling of shared origins. If everything checks out, there is likely no further action and the data is valid. If you still believe there's errors, file an issue to discuss futher.
|
|
31
|
+
|
|
32
|
+
<a name="contribute"></a>
|
|
33
|
+
|
|
34
|
+
### How can I contribute?
|
|
35
|
+
|
|
36
|
+
Only about 90% of the third party script execution has been assigned to an entity. We could use your help identifying the rest! See [Contributing](#contributing) for details.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: goals
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
1. Quantify the impact of third party scripts on the web.
|
|
6
|
+
1. Identify the third party scripts on the web that have the greatest performance cost.
|
|
7
|
+
1. Give developers the information they need to make informed decisions about which third parties to include on their sites.
|
|
8
|
+
1. Incentivize responsible third party script behavior.
|
|
9
|
+
1. Make this information accessible and useful.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: methodology
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
[HTTP Archive](https://httparchive.org/) is an initiative that tracks how the web is built. Every month, ~4 million sites are crawled with [Lighthouse](https://github.com/GoogleChrome/lighthouse) on mobile. Lighthouse breaks down the total script execution time of each page and attributes the execution to a URL. Using [BigQuery](https://cloud.google.com/bigquery/), this project aggregates the script execution to the origin-level and assigns each origin to the responsible entity.
|