WebDriver/RemoteProtocol/PuppeteerCDPUsage

From MozillaWiki
Jump to: navigation, search

This is an overview of which CDP requests Puppeteer uses for its integration with Chrome, compiled by ochameau.

At first sight, Puppeteer uses 89 CDP methods and 27 events:

% git clone https://github.com/GoogleChrome/puppeteer.git
% cd puppeteer
% git grep "send(" lib/ | grep -oE "send\('[^(]+'" | sed "s/send('//" | sed "s/'.*//" | sort | uniq
% git grep "client.on(" lib/ | grep -oE "client.on\('[^(]+'" | sed "s/client.on('//" | sed "s/'.*//" | sort | uniq

Methods

  • Accessibility.getFullAXTree
  • Browser.close
  • Browser.getVersion
  • Browser.grantPermissions
  • Browser.resetPermissions
  • CSS.disable
  • CSS.enable
  • CSS.getStyleSheetText
  • CSS.startRuleUsageTracking
  • CSS.stopRuleUsageTracking
  • Debugger.disable
  • Debugger.enable
  • Debugger.getScriptSource
  • Debugger.setSkipAllPauses
  • DOM.describeNode
  • DOM.disable
  • DOM.enable
  • DOM.getBoxModel
  • DOM.getContentQuads
  • DOM.setFileInputFiles
  • Emulation.setDefaultBackgroundColorOverride
  • Emulation.setDeviceMetricsOverride
  • Emulation.setEmulatedMedia
  • Emulation.setGeolocationOverride
  • Emulation.setScriptExecutionDisabled
  • Emulation.setTouchEmulationEnabled
  • Input.dispatchKeyEvent
  • Input.dispatchMouseEvent
  • Input.dispatchTouchEvent
  • Input.insertText
  • IO.close
  • IO.read
  • Log.enable
  • Network.continueInterceptedRequest
  • Network.deleteCookies
  • Network.emulateNetworkConditions
  • Network.enable
  • Network.getCookies
  • Network.getResponseBody
  • Network.setCacheDisabled
  • Network.setCookies
  • Network.setExtraHTTPHeaders
  • Network.setRequestInterception
  • Network.setUserAgentOverride
  • Page.addScriptToEvaluateOnNewDocument
  • Page.bringToFront
  • Page.captureScreenshot
  • Page.close
  • Page.enable
  • Page.getFrameTree
  • Page.getLayoutMetrics
  • Page.getNavigationHistory
  • Page.handleJavaScriptDialog
  • Page.navigate
  • Page.navigateToHistoryEntry
  • Page.printToPDF
  • Page.reload
  • Page.setBypassCSP
  • Page.setLifecycleEventsEnabled
  • Performance.enable
  • Performance.getMetrics
  • Profiler.disable
  • Profiler.enable
  • Profiler.startPreciseCoverage
  • Profiler.stopPreciseCoverage
  • Profiler.takePreciseCoverage
  • Runtime.addBinding
  • Runtime.callFunctionOn
  • Runtime.enable
  • Runtime.evaluate
  • Runtime.getProperties
  • Runtime.queryObjects
  • Runtime.releaseObject
  • Security.enable
  • Security.handleCertificateError
  • Security.setOverrideCertificateErrors
  • Target.activateTarget
  • Target.attachToTarget
  • Target.closeTarget
  • Target.createBrowserContext
  • Target.createTarget
  • Target.detachFromTarget
  • Target.disposeBrowserContext
  • Target.getBrowserContexts
  • Target.sendMessageToTarget
  • Target.setAutoAttach
  • Target.setDiscoverTargets
  • Tracing.end
  • Tracing.start

Events

  • Inspector.targetCrashed
  • Log.entryAdded
  • Network.loadingFailed
  • Network.loadingFinished
  • Network.requestIntercepted
  • Network.requestServedFromCache
  • Network.requestWillBeSent
  • Network.responseReceived
  • Page.domContentEventFired
  • Page.frameAttached
  • Page.frameDetached
  • Page.frameNavigated
  • Page.frameStoppedLoading
  • Page.javascriptDialogOpening
  • Page.lifecycleEvent
  • Page.loadEventFired
  • Page.navigatedWithinDocument
  • Performance.metrics
  • Runtime.bindingCalled
  • Runtime.consoleAPICalled
  • Runtime.exceptionThrown
  • Runtime.executionContextCreated
  • Runtime.executionContextDestroyed
  • Runtime.executionContextsCleared
  • Security.certificateError
  • Target.attachedToTarget
  • Target.detachedFromTarget

In Wordpress gutenberg test suite

This subset of the above events is emitted during a gutenberg test run:

Log.entryAdded
Network.loadingFailed
Network.loadingFinished
Network.requestServedFromCache
Network.requestWillBeSent
Network.responseReceived
Page.domContentEventFired
Page.frameAttached
Page.frameDetached
Page.frameStoppedLoading
Page.javascriptDialogOpening
Page.lifecycleEvent
Page.loadEventFired
Page.navigatedWithinDocument
Runtime.consoleAPICalled
Runtime.executionContextDestroyed
Runtime.executionContextsCleared
Target.attachedToTarget
Target.detachedFromTarget