chrome-devtools-frontend 1.0.1650100 → 1.0.1650677
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/.agents/skills/version-control/SKILL.md +5 -1
- package/config/typescript/tsconfig.base.json +1 -0
- package/front_end/core/host/InspectorFrontendHostAPI.ts +0 -1
- package/front_end/core/host/UserMetrics.ts +0 -26
- package/front_end/core/sdk/CSSMetadata.ts +72 -0
- package/front_end/devtools_compatibility.js +1 -2
- package/front_end/foundation/Universe.ts +7 -0
- package/front_end/models/ai_assistance/AiAgent2.ts +11 -1
- package/front_end/models/ai_assistance/README.md +4 -0
- package/front_end/models/ai_assistance/agents/AccessibilityAgent.ts +2 -0
- package/front_end/models/ai_assistance/agents/AiAgent.ts +3 -0
- package/front_end/models/ai_assistance/agents/ExecuteJavascript.ts +13 -4
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +3 -7
- package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
- package/front_end/models/ai_assistance/skills/Skill.ts +1 -1
- package/front_end/models/ai_assistance/skills/SkillRegistry.ts +2 -0
- package/front_end/models/ai_assistance/skills/accessibility.md +13 -0
- package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +54 -0
- package/front_end/models/ai_assistance/tools/ResolveLighthousePath.ts +124 -0
- package/front_end/models/ai_assistance/tools/Tool.ts +12 -2
- package/front_end/models/ai_assistance/tools/ToolRegistry.ts +4 -0
- package/front_end/models/persistence/NetworkPersistenceManager.ts +9 -1
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +3 -11
- package/front_end/panels/common/ExtensionServer.ts +70 -50
- package/front_end/panels/elements/ElementsPanel.ts +1 -1
- package/front_end/panels/js_timeline/js_timeline-meta.ts +1 -2
- package/front_end/panels/network/RequestConditionsDrawer.ts +236 -198
- package/front_end/panels/network/RequestHeadersView.ts +2 -2
- package/front_end/panels/network/components/RequestHeadersView.css +1 -0
- package/front_end/panels/network/components/ResponseHeaderSection.css +5 -1
- package/front_end/panels/network/requestConditionsDrawer.css +3 -0
- package/front_end/panels/recorder/testing/RecorderHelpers.ts +2 -0
- package/front_end/panels/timeline/timeline-meta.ts +1 -1
- package/front_end/panels/whats_new/ReleaseNoteText.ts +12 -6
- package/front_end/panels/whats_new/resources/WNDT.md +8 -7
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/README.md +14 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +60 -24
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +271 -164
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +2 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js +11 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js +3 -10
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +9 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.d.ts +13 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.js +14 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js +5 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/locators/locators.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js +5 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserContext.js +6 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Deserializer.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Deserializer.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ExposedFunction.js +6 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/ExposedFunction.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js +11 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/core/BrowsingContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.js +4 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Accessibility.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Binding.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +13 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/BrowserConnector.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Connection.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Coverage.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Coverage.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ElementHandle.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ElementHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.js +25 -4
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/EmulationManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExecutionContext.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/ExecutionContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Extension.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Extension.js +9 -11
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Extension.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Frame.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js +7 -7
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/FrameManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/HTTPRequest.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/JSHandle.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts +3 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js +18 -10
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/NetworkManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js +17 -11
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Target.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js +28 -10
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/TargetManager.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js +10 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebMCP.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.d.ts +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.js +20 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/WebWorker.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js +11 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserConnector.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/BrowserWebSocketTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/CallbackRegistry.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/CallbackRegistry.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Configuration.d.ts +4 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Configuration.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts +26 -13
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/ConnectOptions.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts +1 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js +24 -33
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/Debug.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts +8 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js +8 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.d.ts +2 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.js +4 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/environment.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/TextContent.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/TextContent.js +15 -5
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/TextContent.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js +17 -16
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/BrowserLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js +14 -9
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ChromeLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/FirefoxLauncher.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/FirefoxLauncher.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/NodeWebSocketTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/PipeTransport.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/PipeTransport.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +20 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +38 -9
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.d.ts.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.js +16 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node-env-setup.js.map +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.js +3 -8
- package/front_end/third_party/puppeteer/package/lib/puppeteer/puppeteer-core.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +60 -24
- package/front_end/third_party/puppeteer/package/package.json +4 -4
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +4 -8
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/api/HTTPRequest.ts +10 -10
- package/front_end/third_party/puppeteer/package/src/api/JSHandle.ts +3 -10
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +14 -8
- package/front_end/third_party/puppeteer/package/src/api/WebWorker.ts +30 -0
- package/front_end/third_party/puppeteer/package/src/api/locators/locators.ts +5 -5
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserConnector.ts +5 -3
- package/front_end/third_party/puppeteer/package/src/bidi/BrowserContext.ts +6 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Connection.ts +4 -4
- package/front_end/third_party/puppeteer/package/src/bidi/Deserializer.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/bidi/ExposedFunction.ts +6 -6
- package/front_end/third_party/puppeteer/package/src/bidi/Frame.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Realm.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/bidi/core/BrowsingContext.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Accessibility.ts +6 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Binding.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +14 -2
- package/front_end/third_party/puppeteer/package/src/cdp/BrowserConnector.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Connection.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/Coverage.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/cdp/ElementHandle.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/EmulationManager.ts +36 -4
- package/front_end/third_party/puppeteer/package/src/cdp/ExecutionContext.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/Extension.ts +16 -17
- package/front_end/third_party/puppeteer/package/src/cdp/Frame.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/FrameManager.ts +12 -7
- package/front_end/third_party/puppeteer/package/src/cdp/HTTPRequest.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/JSHandle.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/cdp/NetworkManager.ts +22 -11
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +18 -10
- package/front_end/third_party/puppeteer/package/src/cdp/Target.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/cdp/TargetManager.ts +37 -12
- package/front_end/third_party/puppeteer/package/src/cdp/WebMCP.ts +11 -9
- package/front_end/third_party/puppeteer/package/src/cdp/WebWorker.ts +33 -5
- package/front_end/third_party/puppeteer/package/src/common/BrowserConnector.ts +11 -0
- package/front_end/third_party/puppeteer/package/src/common/BrowserWebSocketTransport.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/common/CallbackRegistry.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/common/Configuration.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/common/ConnectOptions.ts +26 -13
- package/front_end/third_party/puppeteer/package/src/common/Debug.ts +30 -40
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/common/util.ts +9 -1
- package/front_end/third_party/puppeteer/package/src/environment.ts +7 -3
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/TextContent.ts +15 -5
- package/front_end/third_party/puppeteer/package/src/node/BrowserLauncher.ts +23 -23
- package/front_end/third_party/puppeteer/package/src/node/ChromeLauncher.ts +19 -13
- package/front_end/third_party/puppeteer/package/src/node/FirefoxLauncher.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/NodeWebSocketTransport.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/node/PipeTransport.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +44 -9
- package/front_end/third_party/puppeteer/package/src/node-env-setup.ts +18 -0
- package/front_end/third_party/puppeteer/package/src/puppeteer-core.ts +5 -9
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/third_party/puppeteer/puppeteer-tsconfig.json +1 -0
- package/front_end/third_party/third-party-web/lib/nostats-subset.js +21 -15
- package/front_end/third_party/third-party-web/package/README.md +619 -582
- package/front_end/third_party/third-party-web/package/dist/entities-httparchive-nostats.json +1 -1
- package/front_end/third_party/third-party-web/package/dist/entities-httparchive.json +1 -1
- package/front_end/third_party/third-party-web/package/dist/entities-nostats.json +1 -1
- package/front_end/third_party/third-party-web/package/dist/entities.json +1 -1
- package/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.js +27 -15
- package/front_end/third_party/third-party-web/package/lib/create-entity-finder-api.test.js +14 -0
- package/front_end/third_party/third-party-web/package/lib/entities.test.js +10 -0
- package/front_end/third_party/third-party-web/package/lib/index.test.js +6 -6
- package/front_end/third_party/third-party-web/package/lib/markdown/template.md +1 -3
- package/front_end/third_party/third-party-web/package/package.json +7 -3
- package/front_end/third_party/third-party-web/package.json +1 -1
- package/front_end/tsconfig.json +1 -2
- package/front_end/ui/components/buttons/floatingButton.css +3 -3
- package/front_end/ui/components/lists/list.css +2 -0
- package/front_end/ui/legacy/ListWidget.ts +8 -5
- package/front_end/ui/legacy/TextPrompt.ts +5 -2
- package/front_end/ui/legacy/textPrompt.css +1 -0
- package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
- package/inspector_overlay/tsconfig.json +3 -10
- package/mcp/tsconfig.json +1 -5
- package/package.json +1 -2
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
// Copyright 2015 The Chromium Authors
|
|
2
2
|
// Use of this source code is governed by a BSD-style license that can be
|
|
3
3
|
// found in the LICENSE file.
|
|
4
|
-
/* eslint-disable @devtools/no-lit-render-outside-of-view */
|
|
5
|
-
/* eslint-disable @devtools/no-imperative-dom-api */
|
|
6
4
|
|
|
7
|
-
import '../../ui/
|
|
5
|
+
import '../../ui/components/lists/lists.js';
|
|
8
6
|
import '../../ui/components/tooltips/tooltips.js';
|
|
7
|
+
import '../../ui/legacy/legacy.js';
|
|
9
8
|
|
|
10
9
|
import type * as Common from '../../core/common/common.js';
|
|
11
10
|
import * as i18n from '../../core/i18n/i18n.js';
|
|
@@ -14,7 +13,6 @@ import * as SDK from '../../core/sdk/sdk.js';
|
|
|
14
13
|
import * as Logs from '../../models/logs/logs.js';
|
|
15
14
|
import * as Buttons from '../../ui/components/buttons/buttons.js';
|
|
16
15
|
import * as uiI18n from '../../ui/i18n/i18n.js';
|
|
17
|
-
import {Link} from '../../ui/kit/kit.js';
|
|
18
16
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
19
17
|
import {Directives, html, type LitTemplate, nothing, render} from '../../ui/lit/lit.js';
|
|
20
18
|
import * as VisualLogging from '../../ui/visual_logging/visual_logging.js';
|
|
@@ -23,7 +21,7 @@ import * as PanelUtils from '../utils/utils.js';
|
|
|
23
21
|
|
|
24
22
|
import requestConditionsDrawerStyles from './requestConditionsDrawer.css.js';
|
|
25
23
|
|
|
26
|
-
const {ref, live} = Directives;
|
|
24
|
+
const {ref, live, ifDefined} = Directives;
|
|
27
25
|
const {widget} = UI.Widget;
|
|
28
26
|
|
|
29
27
|
const UIStrings = {
|
|
@@ -87,10 +85,6 @@ const UIStrings = {
|
|
|
87
85
|
* @description Message to be announced for a when list item is removed from list widget
|
|
88
86
|
*/
|
|
89
87
|
learnMore: 'Learn more',
|
|
90
|
-
/**
|
|
91
|
-
* @description Accessibility label on a `Learn more` link
|
|
92
|
-
*/
|
|
93
|
-
learnMoreLabel: 'Learn more about URL pattern syntax',
|
|
94
88
|
/**
|
|
95
89
|
* @description Tooltip on a button moving an entry up
|
|
96
90
|
* @example {*://example.com} PH1
|
|
@@ -118,38 +112,42 @@ const UIStrings = {
|
|
|
118
112
|
* @description Aria announcemenet when a pattern was moved down
|
|
119
113
|
*/
|
|
120
114
|
patternMovedDown: 'URL pattern was moved down',
|
|
121
|
-
/**
|
|
122
|
-
* @description Text on a button to start editing text
|
|
123
|
-
* @example {*://example.com} PH1
|
|
124
|
-
*/
|
|
125
|
-
editPattern: 'Edit {PH1}',
|
|
126
|
-
/**
|
|
127
|
-
* @description Label for an item to remove something
|
|
128
|
-
* @example {*://example.com} PH1
|
|
129
|
-
*/
|
|
130
|
-
removePattern: 'Remove {PH1}',
|
|
131
115
|
} as const;
|
|
132
116
|
const str_ = i18n.i18n.registerUIStrings('panels/network/RequestConditionsDrawer.ts', UIStrings);
|
|
133
117
|
const i18nString = i18n.i18n.getLocalizedString.bind(undefined, str_);
|
|
134
118
|
|
|
135
119
|
const NETWORK_REQUEST_BLOCKING_EXPLANATION_URL =
|
|
136
120
|
'https://developer.chrome.com/docs/devtools/network-request-blocking' as Platform.DevToolsPath.UrlString;
|
|
137
|
-
const PATTERN_API_DOCS_URL =
|
|
138
|
-
'https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API' as Platform.DevToolsPath.UrlString;
|
|
139
121
|
|
|
140
122
|
const {bindToAction} = UI.UIUtils;
|
|
141
123
|
|
|
142
124
|
interface ViewInput {
|
|
143
|
-
|
|
125
|
+
conditions: SDK.NetworkManager.RequestCondition[];
|
|
126
|
+
editingCondition?: SDK.NetworkManager.RequestCondition;
|
|
144
127
|
enabled: boolean;
|
|
145
128
|
toggleEnabled: () => void;
|
|
146
129
|
addPattern: () => void;
|
|
130
|
+
onToggle: (condition: SDK.NetworkManager.RequestCondition) => void;
|
|
131
|
+
onConditionsChanged: (condition: SDK.NetworkManager.RequestCondition,
|
|
132
|
+
conditions: SDK.NetworkManager.ThrottlingConditions) => void;
|
|
133
|
+
onIncreasePriority: (condition: SDK.NetworkManager.RequestCondition) => void;
|
|
134
|
+
onDecreasePriority: (condition: SDK.NetworkManager.RequestCondition) => void;
|
|
135
|
+
onCommit: (condition: SDK.NetworkManager.RequestCondition, value: string) => void;
|
|
136
|
+
onCancel: (condition: SDK.NetworkManager.RequestCondition) => void;
|
|
137
|
+
onBeginEdit: (condition: SDK.NetworkManager.RequestCondition) => void;
|
|
138
|
+
onRemove: (condition: SDK.NetworkManager.RequestCondition) => void;
|
|
139
|
+
validator: (condition: SDK.NetworkManager.RequestCondition, value: string) => Common.UIString.LocalizedString | null;
|
|
140
|
+
lookUpRequestCount: (condition: SDK.NetworkManager.RequestCondition) => number;
|
|
141
|
+
}
|
|
142
|
+
interface ViewOutput {
|
|
143
|
+
itemRefs: Map<SDK.NetworkManager.RequestCondition, HTMLElement|undefined>;
|
|
147
144
|
}
|
|
148
|
-
type View = (input: ViewInput, output:
|
|
145
|
+
type View = (input: ViewInput, output: ViewOutput, target: HTMLElement) => void;
|
|
149
146
|
export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
150
147
|
render(
|
|
151
148
|
// clang-format off
|
|
152
149
|
html`
|
|
150
|
+
<style>${requestConditionsDrawerStyles}</style>
|
|
153
151
|
<devtools-toolbar jslog=${VisualLogging.toolbar()}>
|
|
154
152
|
<devtools-checkbox
|
|
155
153
|
?checked=${input.enabled}
|
|
@@ -161,7 +159,9 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
161
159
|
<devtools-button ${bindToAction('network.add-network-request-blocking-pattern')}></devtools-button>
|
|
162
160
|
<devtools-button ${bindToAction('network.remove-all-network-request-blocking-patterns')}></devtools-button>
|
|
163
161
|
</devtools-toolbar>
|
|
164
|
-
|
|
162
|
+
${input.conditions.length === 0 ? html`
|
|
163
|
+
<div class="list">
|
|
164
|
+
<div class=empty-state>
|
|
165
165
|
<span class=empty-state-header>${i18nString(UIStrings.noPattern)}</span>
|
|
166
166
|
<div class=empty-state-description>
|
|
167
167
|
${uiI18n.getFormatLocalizedStringTemplate(str_, UIStrings.noThrottlingOrBlockingPattern, {PH1: learnMore()})}
|
|
@@ -175,22 +175,71 @@ export const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
175
175
|
${i18nString(UIStrings.addRule)}
|
|
176
176
|
</devtools-button>
|
|
177
177
|
</div>
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
178
|
+
</div>
|
|
179
|
+
` : html`
|
|
180
|
+
<devtools-list
|
|
181
|
+
class="blocked-urls list square-corners"
|
|
182
|
+
?deletable=${input.enabled}
|
|
183
|
+
@edit=${(e: CustomEvent<{index: number}>) => input.onBeginEdit(input.conditions[e.detail.index])}
|
|
184
|
+
@delete=${(e: CustomEvent<{index: number}>) => input.onRemove(input.conditions[e.detail.index])}>
|
|
185
|
+
${input.conditions.map((condition, index) => html`
|
|
186
|
+
<div class="blocked-url" ${ref(e => {
|
|
187
|
+
output.itemRefs.set(condition, e as HTMLElement | undefined);
|
|
188
|
+
})}>
|
|
189
|
+
${renderItem({
|
|
190
|
+
condition,
|
|
191
|
+
editing: input.editingCondition === condition,
|
|
192
|
+
editable: input.enabled,
|
|
193
|
+
index,
|
|
194
|
+
onToggle: input.onToggle,
|
|
195
|
+
onConditionsChanged: input.onConditionsChanged,
|
|
196
|
+
onIncreasePriority: input.onIncreasePriority,
|
|
197
|
+
onDecreasePriority: input.onDecreasePriority,
|
|
198
|
+
onCommit: input.onCommit,
|
|
199
|
+
onCancel: input.onCancel,
|
|
200
|
+
onBeginEdit: input.onBeginEdit,
|
|
201
|
+
validator: val => input.validator(condition, val),
|
|
202
|
+
lookUpRequestCount: input.lookUpRequestCount
|
|
203
|
+
})}
|
|
204
|
+
</div>
|
|
205
|
+
`)}
|
|
206
|
+
</devtools-list>
|
|
207
|
+
`}
|
|
181
208
|
`,
|
|
182
209
|
// clang-format on
|
|
183
|
-
target);
|
|
210
|
+
target, {container: {classes: (!input.enabled && input.conditions.length > 0) ? ['blocking-disabled'] : []}});
|
|
184
211
|
};
|
|
185
212
|
|
|
186
|
-
function renderItem(
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
213
|
+
function renderItem({
|
|
214
|
+
condition,
|
|
215
|
+
editing,
|
|
216
|
+
editable,
|
|
217
|
+
index,
|
|
218
|
+
onToggle,
|
|
219
|
+
onConditionsChanged,
|
|
220
|
+
onIncreasePriority,
|
|
221
|
+
onDecreasePriority,
|
|
222
|
+
onCommit,
|
|
223
|
+
onCancel,
|
|
224
|
+
onBeginEdit,
|
|
225
|
+
validator,
|
|
226
|
+
lookUpRequestCount
|
|
227
|
+
}: {
|
|
228
|
+
condition: SDK.NetworkManager.RequestCondition,
|
|
229
|
+
editing: boolean,
|
|
230
|
+
editable: boolean,
|
|
231
|
+
index: number,
|
|
232
|
+
onToggle: (condition: SDK.NetworkManager.RequestCondition) => void,
|
|
233
|
+
onConditionsChanged:
|
|
234
|
+
(condition: SDK.NetworkManager.RequestCondition, conditions: SDK.NetworkManager.ThrottlingConditions) => void,
|
|
235
|
+
onIncreasePriority: (condition: SDK.NetworkManager.RequestCondition) => void,
|
|
236
|
+
onDecreasePriority: (condition: SDK.NetworkManager.RequestCondition) => void,
|
|
237
|
+
onCommit: (condition: SDK.NetworkManager.RequestCondition, value: string) => void,
|
|
238
|
+
onCancel: (condition: SDK.NetworkManager.RequestCondition) => void,
|
|
239
|
+
onBeginEdit: (condition: SDK.NetworkManager.RequestCondition) => void,
|
|
240
|
+
validator: (value: string) => Common.UIString.LocalizedString | null,
|
|
241
|
+
lookUpRequestCount: (condition: SDK.NetworkManager.RequestCondition) => number,
|
|
242
|
+
}): LitTemplate {
|
|
194
243
|
const {enabled, originalOrUpgradedURLPattern, constructorStringOrWildcardURL, wildcardURL} = condition;
|
|
195
244
|
const toggle = (e: Event): void => {
|
|
196
245
|
e.consume(true);
|
|
@@ -207,6 +256,25 @@ function renderItem(
|
|
|
207
256
|
onDecreasePriority(condition);
|
|
208
257
|
};
|
|
209
258
|
|
|
259
|
+
const onPromptActivate = (e: Event): void => {
|
|
260
|
+
if (!editable || editing) {
|
|
261
|
+
return;
|
|
262
|
+
}
|
|
263
|
+
onBeginEdit(condition);
|
|
264
|
+
e.consume(true);
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
const promptKeyDown = (e: Event): void => {
|
|
268
|
+
if (!editable || editing) {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
const keyboardEvent = e as KeyboardEvent;
|
|
272
|
+
if (keyboardEvent.key === 'Enter') {
|
|
273
|
+
onBeginEdit(condition);
|
|
274
|
+
e.consume(true);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
|
|
210
278
|
// clang-format off
|
|
211
279
|
return html`
|
|
212
280
|
<input class=blocked-url-checkbox
|
|
@@ -231,7 +299,7 @@ function renderItem(
|
|
|
231
299
|
.jslogContext=${'increase-priority'}
|
|
232
300
|
?disabled=${!editable || !originalOrUpgradedURLPattern}
|
|
233
301
|
@click=${moveDown}></devtools-button>
|
|
234
|
-
${originalOrUpgradedURLPattern ? html`
|
|
302
|
+
${!editing && originalOrUpgradedURLPattern ? html`
|
|
235
303
|
<devtools-tooltip variant=rich jslogcontext=url-pattern id=url-pattern-${index}>
|
|
236
304
|
<div>hash: ${originalOrUpgradedURLPattern.hash}</div>
|
|
237
305
|
<div>hostname: ${originalOrUpgradedURLPattern.hostname}</div>
|
|
@@ -244,14 +312,14 @@ function renderItem(
|
|
|
244
312
|
<hr />
|
|
245
313
|
${learnMore()}
|
|
246
314
|
</devtools-tooltip>` : nothing}
|
|
247
|
-
${wildcardURL ? html`
|
|
315
|
+
${!editing && wildcardURL ? html`
|
|
248
316
|
<devtools-icon name=warning-filled class="small warning" aria-details=url-pattern-warning-${index}>
|
|
249
317
|
</devtools-icon>
|
|
250
318
|
<devtools-tooltip variant=rich jslogcontext=url-pattern-warning id=url-pattern-warning-${index}>
|
|
251
319
|
${i18nString(UIStrings.patternWasUpgraded, {PH1: wildcardURL})}
|
|
252
320
|
</devtools-tooltip>
|
|
253
321
|
`: nothing}
|
|
254
|
-
${!originalOrUpgradedURLPattern ? html`
|
|
322
|
+
${!editing && !originalOrUpgradedURLPattern ? html`
|
|
255
323
|
<devtools-icon name=cross-circle-filled class=small aria-details=url-pattern-error-${index}>
|
|
256
324
|
</devtools-icon>
|
|
257
325
|
<devtools-tooltip variant=rich jslogcontext=url-pattern-warning id=url-pattern-error-${index}>
|
|
@@ -261,13 +329,22 @@ function renderItem(
|
|
|
261
329
|
: i18nString(UIStrings.patternFailedToParse)}
|
|
262
330
|
${learnMore()}
|
|
263
331
|
</devtools-tooltip>`: nothing}
|
|
264
|
-
<
|
|
265
|
-
@click=${
|
|
266
|
-
|
|
332
|
+
<devtools-prompt
|
|
333
|
+
@click=${onPromptActivate}
|
|
334
|
+
@keydown=${promptKeyDown}
|
|
335
|
+
@focus=${onPromptActivate}
|
|
336
|
+
tabindex=${ifDefined(editing ? undefined : 0)}
|
|
337
|
+
@commit=${(e: UI.TextPrompt.TextPromptElement.CommitEvent) => onCommit(condition, e.detail)}
|
|
338
|
+
@cancel=${() => onCancel(condition)}
|
|
339
|
+
?disabled=${!editable}
|
|
340
|
+
placeholder=${i18nString(UIStrings.textEditPattern)}
|
|
341
|
+
value=${constructorStringOrWildcardURL}
|
|
342
|
+
?editing=${editable && editing}
|
|
343
|
+
.validator=${validator}
|
|
267
344
|
class=blocked-url-label
|
|
268
345
|
aria-details=url-pattern-${index}>
|
|
269
346
|
${constructorStringOrWildcardURL}
|
|
270
|
-
</
|
|
347
|
+
</devtools-prompt>
|
|
271
348
|
<select
|
|
272
349
|
class=conditions-selector
|
|
273
350
|
title=${i18nString(UIStrings.requestConditionsLabel)}
|
|
@@ -293,9 +370,8 @@ interface AffectedCountViewInput {
|
|
|
293
370
|
}
|
|
294
371
|
type AffectedCountView = (input: AffectedCountViewInput, output: object, target: HTMLElement) => void;
|
|
295
372
|
export const AFFECTED_COUNT_DEFAULT_VIEW: AffectedCountView = (input, output, target) => {
|
|
296
|
-
render(
|
|
297
|
-
|
|
298
|
-
{container: {classes: ['blocked-url-count']}});
|
|
373
|
+
render(html`${i18nString(UIStrings.dAffected, {PH1: input.count})}`, target,
|
|
374
|
+
{container: {classes: ['blocked-url-count']}});
|
|
299
375
|
};
|
|
300
376
|
|
|
301
377
|
function matchesUrl(conditions: SDK.NetworkManager.RequestCondition, url: string): boolean {
|
|
@@ -338,9 +414,9 @@ export class AffectedCountWidget extends UI.Widget.Widget {
|
|
|
338
414
|
}
|
|
339
415
|
|
|
340
416
|
override wasShown(): void {
|
|
341
|
-
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
342
|
-
|
|
343
|
-
|
|
417
|
+
SDK.TargetManager.TargetManager.instance().addModelListener(SDK.NetworkManager.NetworkManager,
|
|
418
|
+
SDK.NetworkManager.Events.RequestFinished,
|
|
419
|
+
this.#onRequestFinished, this, {scoped: true});
|
|
344
420
|
Logs.NetworkLog.NetworkLog.instance().addEventListener(Logs.NetworkLog.Events.Reset, this.requestUpdate, this);
|
|
345
421
|
super.wasShown();
|
|
346
422
|
}
|
|
@@ -375,15 +451,13 @@ function learnMore(): LitTemplate {
|
|
|
375
451
|
</devtools-link>`;
|
|
376
452
|
}
|
|
377
453
|
|
|
378
|
-
export class RequestConditionsDrawer extends UI.Widget.VBox
|
|
379
|
-
UI.ListWidget.Delegate<SDK.NetworkManager.RequestCondition> {
|
|
454
|
+
export class RequestConditionsDrawer extends UI.Widget.VBox {
|
|
380
455
|
private manager: SDK.NetworkManager.MultitargetNetworkManager;
|
|
381
|
-
private readonly list: UI.ListWidget.ListWidget<SDK.NetworkManager.RequestCondition>;
|
|
382
|
-
private editor: UI.ListWidget.Editor<SDK.NetworkManager.RequestCondition>|null;
|
|
383
456
|
private blockedCountForUrl: Map<Platform.DevToolsPath.UrlString, number>;
|
|
384
457
|
#throttledCount = new Map<string, number>();
|
|
385
458
|
#view: View;
|
|
386
|
-
#
|
|
459
|
+
#viewOutput: ViewOutput = {itemRefs: new Map()};
|
|
460
|
+
#editingCondition?: SDK.NetworkManager.RequestCondition;
|
|
387
461
|
|
|
388
462
|
constructor(target?: HTMLElement, view = DEFAULT_VIEW) {
|
|
389
463
|
super(target, {
|
|
@@ -393,187 +467,147 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
|
393
467
|
this.#view = view;
|
|
394
468
|
|
|
395
469
|
this.manager = SDK.NetworkManager.MultitargetNetworkManager.instance();
|
|
396
|
-
this.manager.addEventListener(
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
this.list = new UI.ListWidget.ListWidget(this);
|
|
400
|
-
this.list.registerRequiredCSS(requestConditionsDrawerStyles);
|
|
401
|
-
this.list.element.classList.add('blocked-urls');
|
|
402
|
-
|
|
403
|
-
this.editor = null;
|
|
470
|
+
this.manager.addEventListener(SDK.NetworkManager.MultitargetNetworkManager.Events.BLOCKED_PATTERNS_CHANGED,
|
|
471
|
+
this.requestUpdate, this);
|
|
404
472
|
|
|
405
473
|
this.blockedCountForUrl = new Map();
|
|
406
|
-
SDK.TargetManager.TargetManager.instance().addModelListener(
|
|
407
|
-
|
|
408
|
-
|
|
474
|
+
SDK.TargetManager.TargetManager.instance().addModelListener(SDK.NetworkManager.NetworkManager,
|
|
475
|
+
SDK.NetworkManager.Events.RequestFinished,
|
|
476
|
+
this.onRequestFinished, this, {scoped: true});
|
|
409
477
|
|
|
410
|
-
this.
|
|
478
|
+
this.requestUpdate();
|
|
411
479
|
Logs.NetworkLog.NetworkLog.instance().addEventListener(Logs.NetworkLog.Events.Reset, this.onNetworkLogReset, this);
|
|
412
480
|
}
|
|
413
481
|
|
|
414
482
|
override performUpdate(): void {
|
|
483
|
+
this.#viewOutput.itemRefs.clear();
|
|
415
484
|
const enabled = this.manager.requestConditions.conditionsEnabled;
|
|
416
|
-
|
|
485
|
+
const conditions = Array.from(this.manager.requestConditions.conditions);
|
|
486
|
+
if (this.#editingCondition && !conditions.includes(this.#editingCondition)) {
|
|
487
|
+
conditions.unshift(this.#editingCondition);
|
|
488
|
+
}
|
|
417
489
|
|
|
418
490
|
const input: ViewInput = {
|
|
419
491
|
addPattern: this.addPattern.bind(this),
|
|
420
492
|
toggleEnabled: this.toggleEnabled.bind(this),
|
|
421
493
|
enabled,
|
|
422
|
-
|
|
494
|
+
conditions,
|
|
495
|
+
editingCondition: this.#editingCondition,
|
|
496
|
+
onToggle: (condition: SDK.NetworkManager.RequestCondition) => {
|
|
497
|
+
if (enabled) {
|
|
498
|
+
condition.enabled = !condition.enabled;
|
|
499
|
+
}
|
|
500
|
+
},
|
|
501
|
+
onConditionsChanged:
|
|
502
|
+
(condition: SDK.NetworkManager.RequestCondition, conditions: SDK.NetworkManager.ThrottlingConditions) => {
|
|
503
|
+
if (enabled) {
|
|
504
|
+
condition.conditions = conditions;
|
|
505
|
+
}
|
|
506
|
+
},
|
|
507
|
+
onIncreasePriority: (condition: SDK.NetworkManager.RequestCondition) => {
|
|
508
|
+
if (enabled) {
|
|
509
|
+
UI.ARIAUtils.LiveAnnouncer.status(i18nString(UIStrings.patternMovedUp));
|
|
510
|
+
this.manager.requestConditions.increasePriority(condition);
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
onDecreasePriority: (condition: SDK.NetworkManager.RequestCondition) => {
|
|
514
|
+
if (enabled) {
|
|
515
|
+
UI.ARIAUtils.LiveAnnouncer.status(i18nString(UIStrings.patternMovedDown));
|
|
516
|
+
this.manager.requestConditions.decreasePriority(condition);
|
|
517
|
+
}
|
|
518
|
+
},
|
|
519
|
+
onBeginEdit: (condition: SDK.NetworkManager.RequestCondition) => {
|
|
520
|
+
if (this.#editingCondition) {
|
|
521
|
+
this.#cancelEdit(this.#editingCondition);
|
|
522
|
+
}
|
|
523
|
+
this.#editingCondition = condition;
|
|
524
|
+
this.requestUpdate();
|
|
525
|
+
},
|
|
526
|
+
onRemove: (condition: SDK.NetworkManager.RequestCondition) => {
|
|
527
|
+
this.manager.requestConditions.delete(condition);
|
|
528
|
+
UI.ARIAUtils.LiveAnnouncer.alert(UIStrings.itemDeleted);
|
|
529
|
+
},
|
|
530
|
+
onCommit: this.#commitEdit.bind(this),
|
|
531
|
+
onCancel: this.#cancelEdit.bind(this),
|
|
532
|
+
validator: this.#validator.bind(this),
|
|
533
|
+
lookUpRequestCount: this.#getRequestCount.bind(this),
|
|
423
534
|
};
|
|
424
|
-
this.#view(input,
|
|
535
|
+
this.#view(input, this.#viewOutput, this.contentElement);
|
|
425
536
|
}
|
|
426
537
|
|
|
427
538
|
addPattern(): void {
|
|
428
539
|
this.manager.requestConditions.conditionsEnabled = true;
|
|
429
|
-
this
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
540
|
+
if (this.#editingCondition) {
|
|
541
|
+
this.#cancelEdit(this.#editingCondition);
|
|
542
|
+
}
|
|
543
|
+
const condition = SDK.NetworkManager.RequestCondition.createFromSetting(
|
|
544
|
+
{url: Platform.DevToolsPath.EmptyUrlString, enabled: true});
|
|
545
|
+
this.#editingCondition = condition;
|
|
546
|
+
this.requestUpdate();
|
|
433
547
|
}
|
|
434
548
|
|
|
435
549
|
removeAllPatterns(): void {
|
|
436
550
|
this.manager.requestConditions.clear();
|
|
437
551
|
}
|
|
438
552
|
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
if (editable) {
|
|
459
|
-
condition.conditions = conditions;
|
|
460
|
-
}
|
|
461
|
-
};
|
|
462
|
-
|
|
463
|
-
const onIncreasePriority = (condition: SDK.NetworkManager.RequestCondition): void => {
|
|
464
|
-
if (this.manager.requestConditions.conditionsEnabled) {
|
|
465
|
-
UI.ARIAUtils.LiveAnnouncer.status(i18nString(UIStrings.patternMovedUp));
|
|
466
|
-
this.manager.requestConditions.increasePriority(condition);
|
|
467
|
-
}
|
|
468
|
-
};
|
|
469
|
-
|
|
470
|
-
const onDecreasePriority = (condition: SDK.NetworkManager.RequestCondition): void => {
|
|
471
|
-
if (this.manager.requestConditions.conditionsEnabled) {
|
|
472
|
-
UI.ARIAUtils.LiveAnnouncer.status(i18nString(UIStrings.patternMovedDown));
|
|
473
|
-
this.manager.requestConditions.decreasePriority(condition);
|
|
474
|
-
}
|
|
475
|
-
};
|
|
476
|
-
|
|
477
|
-
render(
|
|
478
|
-
renderItem(
|
|
479
|
-
condition, editable, index, onToggle, onConditionsChanged, onIncreasePriority, onDecreasePriority,
|
|
480
|
-
this.#getRequestCount.bind(this)),
|
|
481
|
-
element);
|
|
553
|
+
#validator(condition: SDK.NetworkManager.RequestCondition, value: string): Common.UIString.LocalizedString|null {
|
|
554
|
+
if (!value) {
|
|
555
|
+
return i18nString(UIStrings.patternInputCannotBeEmpty);
|
|
556
|
+
}
|
|
557
|
+
const parsedPattern =
|
|
558
|
+
SDK.NetworkManager.RequestURLPattern.create(value as SDK.NetworkManager.URLPatternConstructorString);
|
|
559
|
+
const stringToCheck = parsedPattern ? parsedPattern.constructorString : value;
|
|
560
|
+
const existingCondition = this.manager.requestConditions.findCondition(stringToCheck);
|
|
561
|
+
if (existingCondition && existingCondition !== condition) {
|
|
562
|
+
return i18nString(UIStrings.patternAlreadyExists);
|
|
563
|
+
}
|
|
564
|
+
const isValid = SDK.NetworkManager.RequestURLPattern.isValidPattern(value);
|
|
565
|
+
switch (isValid) {
|
|
566
|
+
case SDK.NetworkManager.RequestURLPatternValidity.FAILED_TO_PARSE:
|
|
567
|
+
return i18nString(UIStrings.patternFailedToParse);
|
|
568
|
+
case SDK.NetworkManager.RequestURLPatternValidity.HAS_REGEXP_GROUPS:
|
|
569
|
+
return i18nString(UIStrings.patternFailedWithRegExpGroups);
|
|
570
|
+
}
|
|
571
|
+
return null;
|
|
482
572
|
}
|
|
483
573
|
|
|
484
574
|
private toggleEnabled(): void {
|
|
485
575
|
this.manager.requestConditions.conditionsEnabled = !this.manager.requestConditions.conditionsEnabled;
|
|
486
|
-
this.
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
removeItemRequested(condition: SDK.NetworkManager.RequestCondition): void {
|
|
490
|
-
this.manager.requestConditions.delete(condition);
|
|
491
|
-
UI.ARIAUtils.LiveAnnouncer.alert(UIStrings.itemDeleted);
|
|
576
|
+
this.requestUpdate();
|
|
492
577
|
}
|
|
493
578
|
|
|
494
|
-
|
|
495
|
-
this
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
}
|
|
579
|
+
#commitEdit(condition: SDK.NetworkManager.RequestCondition, value: string): void {
|
|
580
|
+
if (this.#editingCondition !== condition) {
|
|
581
|
+
return;
|
|
582
|
+
}
|
|
499
583
|
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
584
|
+
if (condition.constructorStringOrWildcardURL === value &&
|
|
585
|
+
Array.from(this.manager.requestConditions.conditions).includes(condition)) {
|
|
586
|
+
this.#editingCondition = undefined;
|
|
587
|
+
this.requestUpdate();
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
const constructorString = value as SDK.NetworkManager.URLPatternConstructorString;
|
|
504
591
|
const pattern = SDK.NetworkManager.RequestURLPattern.create(constructorString);
|
|
505
592
|
if (!pattern) {
|
|
506
|
-
|
|
507
|
-
}
|
|
508
|
-
item.pattern = pattern;
|
|
509
|
-
if (isNew) {
|
|
510
|
-
this.manager.requestConditions.add(item);
|
|
593
|
+
return;
|
|
511
594
|
}
|
|
512
|
-
|
|
595
|
+
condition.pattern = pattern;
|
|
513
596
|
|
|
514
|
-
|
|
515
|
-
if (this.
|
|
516
|
-
|
|
597
|
+
// If it's a new item, it isn't in the manager yet. Add it.
|
|
598
|
+
if (!Array.from(this.manager.requestConditions.conditions).includes(condition)) {
|
|
599
|
+
this.manager.requestConditions.add(condition);
|
|
517
600
|
}
|
|
518
601
|
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
const titles = content.createChild('div', 'blocked-url-edit-row');
|
|
522
|
-
const label = titles.createChild('label');
|
|
523
|
-
const learnMore = Link.create(PATTERN_API_DOCS_URL, i18nString(UIStrings.learnMore), undefined, 'learn-more');
|
|
524
|
-
learnMore.title = i18nString(UIStrings.learnMoreLabel);
|
|
525
|
-
titles.append('\xA0', learnMore);
|
|
526
|
-
label.textContent = i18nString(UIStrings.textEditPattern);
|
|
527
|
-
const fields = content.createChild('div', 'blocked-url-edit-row');
|
|
528
|
-
const validator =
|
|
529
|
-
(_item: SDK.NetworkManager.RequestCondition, _index: number, input: UI.ListWidget.EditorControl): {
|
|
530
|
-
valid: boolean,
|
|
531
|
-
errorMessage?: Common.UIString.LocalizedString,
|
|
532
|
-
} => {
|
|
533
|
-
if (!input.value) {
|
|
534
|
-
return {errorMessage: i18nString(UIStrings.patternInputCannotBeEmpty), valid: false};
|
|
535
|
-
}
|
|
536
|
-
if (this.manager.requestConditions.has(input.value)) {
|
|
537
|
-
return {errorMessage: i18nString(UIStrings.patternAlreadyExists), valid: false};
|
|
538
|
-
}
|
|
539
|
-
const isValid = SDK.NetworkManager.RequestURLPattern.isValidPattern(input.value);
|
|
540
|
-
switch (isValid) {
|
|
541
|
-
case SDK.NetworkManager.RequestURLPatternValidity.FAILED_TO_PARSE:
|
|
542
|
-
return {errorMessage: i18nString(UIStrings.patternFailedToParse), valid: false};
|
|
543
|
-
case SDK.NetworkManager.RequestURLPatternValidity.HAS_REGEXP_GROUPS:
|
|
544
|
-
return {errorMessage: i18nString(UIStrings.patternFailedWithRegExpGroups), valid: false};
|
|
545
|
-
}
|
|
546
|
-
return {valid: true};
|
|
547
|
-
};
|
|
548
|
-
const urlInput = editor.createInput('url', 'text', '', validator);
|
|
549
|
-
label.htmlFor = urlInput.id = 'editor-url-input';
|
|
550
|
-
fields.createChild('div', 'blocked-url-edit-value').appendChild(urlInput);
|
|
551
|
-
return editor;
|
|
602
|
+
this.#editingCondition = undefined;
|
|
603
|
+
this.requestUpdate();
|
|
552
604
|
}
|
|
553
605
|
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
let oldIndex = 0;
|
|
559
|
-
for (; oldIndex < newItems.length; ++oldIndex) {
|
|
560
|
-
const pattern = newItems[oldIndex];
|
|
561
|
-
this.list.updateItem(
|
|
562
|
-
oldIndex,
|
|
563
|
-
pattern,
|
|
564
|
-
enabled,
|
|
565
|
-
/* focusable=*/ false,
|
|
566
|
-
{
|
|
567
|
-
edit: i18nString(UIStrings.editPattern, {PH1: pattern.constructorStringOrWildcardURL}),
|
|
568
|
-
delete: i18nString(UIStrings.removePattern, {PH1: pattern.constructorStringOrWildcardURL})
|
|
569
|
-
},
|
|
570
|
-
);
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
while (oldIndex < this.list.items.length) {
|
|
574
|
-
this.list.removeItem(oldIndex);
|
|
606
|
+
#cancelEdit(condition: SDK.NetworkManager.RequestCondition): void {
|
|
607
|
+
if (this.#editingCondition === condition) {
|
|
608
|
+
this.#editingCondition = undefined;
|
|
609
|
+
this.requestUpdate();
|
|
575
610
|
}
|
|
576
|
-
this.requestUpdate();
|
|
577
611
|
}
|
|
578
612
|
|
|
579
613
|
#getRequestCount(condition: SDK.NetworkManager.RequestCondition): number {
|
|
@@ -628,11 +662,15 @@ export class RequestConditionsDrawer extends UI.Widget.VBox implements
|
|
|
628
662
|
console.assert(!!drawer, 'Drawer not initialized');
|
|
629
663
|
return;
|
|
630
664
|
}
|
|
631
|
-
const
|
|
665
|
+
const condition = drawer.manager.requestConditions.conditions.find(
|
|
632
666
|
condition => condition.ruleIds.has(appliedConditions.appliedNetworkConditionsId) &&
|
|
633
667
|
condition.constructorString && condition.constructorString === appliedConditions.urlPattern);
|
|
634
|
-
|
|
635
|
-
|
|
668
|
+
if (condition) {
|
|
669
|
+
const element = drawer.#viewOutput.itemRefs.get(condition);
|
|
670
|
+
if (element) {
|
|
671
|
+
PanelUtils.PanelUtils.highlightElement(element);
|
|
672
|
+
}
|
|
673
|
+
}
|
|
636
674
|
}
|
|
637
675
|
}
|
|
638
676
|
|
|
@@ -412,7 +412,7 @@ function renderHeaderOverridesLink(input: ViewInput): Lit.LitTemplate {
|
|
|
412
412
|
class="link devtools-link"
|
|
413
413
|
jslogcontext="devtools-override"
|
|
414
414
|
>
|
|
415
|
-
<devtools-icon name="help" class="inline-icon
|
|
415
|
+
<devtools-icon name="help" class="inline-icon">
|
|
416
416
|
</devtools-icon>
|
|
417
417
|
</devtools-link>
|
|
418
418
|
<devtools-link
|
|
@@ -424,7 +424,7 @@ function renderHeaderOverridesLink(input: ViewInput): Lit.LitTemplate {
|
|
|
424
424
|
${fileIcon}${Persistence.NetworkPersistenceManager.HEADERS_FILENAME}
|
|
425
425
|
</devtools-link>
|
|
426
426
|
`;
|
|
427
|
-
|
|
427
|
+
// clang-format on
|
|
428
428
|
}
|
|
429
429
|
|
|
430
430
|
function renderRawHeaders(text: string): Lit.TemplateResult {
|
|
@@ -17,5 +17,9 @@ devtools-header-section-row:first-of-type {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
.add-header-button {
|
|
20
|
-
margin: -
|
|
20
|
+
margin: var(--sys-size-5) 0 var(--sys-size-5) var(--sys-size-4);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
devtools-header-section-row + .add-header-button {
|
|
24
|
+
margin-top: calc(-1 * var(--sys-size-3));
|
|
21
25
|
}
|