Skip to content

Commit 821e9c1

Browse files
committed
api(cdp): rename ChromiumSession to CDPSession
1 parent 8aba111 commit 821e9c1

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

docs/api.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
- [class: ChromiumBrowser](#class-chromiumbrowser)
2929
- [class: ChromiumBrowserContext](#class-chromiumbrowsercontext)
3030
- [class: ChromiumCoverage](#class-chromiumcoverage)
31-
- [class: ChromiumSession](#class-chromiumsession)
31+
- [class: CDPSession](#class-cdpsession)
3232
- [class: FirefoxBrowser](#class-firefoxbrowser)
3333
- [class: WebKitBrowser](#class-webkitbrowser)
3434
- [Environment Variables](#environment-variables)
@@ -3735,7 +3735,7 @@ await browser.stopTracing();
37353735
<!-- GEN:stop -->
37363736

37373737
#### chromiumBrowser.newBrowserCDPSession()
3738-
- returns: <[Promise]<[ChromiumSession]>> Promise that resolves to the newly created browser
3738+
- returns: <[Promise]<[CDPSession]>> Promise that resolves to the newly created browser
37393739
session.
37403740

37413741
#### chromiumBrowser.startTracing([page, options])
@@ -3808,7 +3808,7 @@ Emitted when new service worker is created in the context.
38083808

38093809
#### chromiumBrowserContext.newCDPSession(page)
38103810
- `page` <[Page]> Page to create new session for.
3811-
- returns: <[Promise]<[ChromiumSession]>> Promise that resolves to the newly created session.
3811+
- returns: <[Promise]<[CDPSession]>> Promise that resolves to the newly created session.
38123812

38133813
### class: ChromiumCoverage
38143814

@@ -3875,11 +3875,11 @@ const v8toIstanbul = require('v8-to-istanbul');
38753875
> **NOTE** JavaScript Coverage doesn't include anonymous scripts by default. However, scripts with sourceURLs are
38763876
reported.
38773877

3878-
### class: ChromiumSession
3878+
### class: CDPSession
38793879

38803880
* extends: [EventEmitter](https://nodejs.org/api/events.html#events_class_eventemitter)
38813881

3882-
The `ChromiumSession` instances are used to talk raw Chrome Devtools Protocol:
3882+
The `CDPSession` instances are used to talk raw Chrome Devtools Protocol:
38833883
- protocol methods can be called with `session.send` method.
38843884
- protocol events can be subscribed to with `session.on` method.
38853885

@@ -3899,17 +3899,17 @@ await client.send('Animation.setPlaybackRate', {
38993899
```
39003900

39013901
<!-- GEN:toc -->
3902-
- [chromiumSession.detach()](#chromiumsessiondetach)
3903-
- [chromiumSession.send(method[, params])](#chromiumsessionsendmethod-params)
3902+
- [cdpSession.detach()](#cdpsessiondetach)
3903+
- [cdpSession.send(method[, params])](#cdpsessionsendmethod-params)
39043904
<!-- GEN:stop -->
39053905

3906-
#### chromiumSession.detach()
3906+
#### cdpSession.detach()
39073907
- returns: <[Promise]>
39083908

3909-
Detaches the chromiumSession from the target. Once detached, the chromiumSession object won't emit any events and can't be used
3909+
Detaches the CDPSession from the target. Once detached, the CDPSession object won't emit any events and can't be used
39103910
to send messages.
39113911

3912-
#### chromiumSession.send(method[, params])
3912+
#### cdpSession.send(method[, params])
39133913
- `method` <[string]> protocol method name
39143914
- `params` <[Object]> Optional method parameters
39153915
- returns: <[Promise]<[Object]>>
@@ -4034,7 +4034,7 @@ const { chromium } = require('playwright');
40344034
[ChromiumBrowser]: #class-chromiumbrowser "ChromiumBrowser"
40354035
[ChromiumBrowserContext]: #class-chromiumbrowsercontext "ChromiumBrowserContext"
40364036
[ChromiumCoverage]: #class-chromiumcoverage "ChromiumCoverage"
4037-
[ChromiumSession]: #class-chromiumsession "ChromiumSession"
4037+
[CDPSession]: #class-CDPSession "CDPSession"
40384038
[ConsoleMessage]: #class-consolemessage "ConsoleMessage"
40394039
[Dialog]: #class-dialog "Dialog"
40404040
[ElementHandle]: #class-elementhandle "ElementHandle"

src/api.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export { Selectors } from './selectors';
3131
export { CRBrowser as ChromiumBrowser } from './chromium/crBrowser';
3232
export { CRBrowserContext as ChromiumBrowserContext } from './chromium/crBrowser';
3333
export { CRCoverage as ChromiumCoverage } from './chromium/crCoverage';
34-
export { CRSession as ChromiumSession } from './chromium/crConnection';
34+
export { CRSession as CDPSession } from './chromium/crConnection';
3535

3636
export { FFBrowser as FirefoxBrowser } from './firefox/ffBrowser';
3737

utils/doclint/check_public_api/JSBuilder.js

+2
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,8 @@ function checkSources(sources, externalDependencies) {
326326
}
327327

328328
function expandPrefix(name) {
329+
if (name === 'CRSession')
330+
return 'CDPSession';
329331
if (name.startsWith('CR'))
330332
return 'Chromium' + name.substring(2);
331333
if (name.startsWith('FF'))

0 commit comments

Comments
 (0)