Skip to content

Commit e09b169

Browse files
authored
feat(electron): move Electron API to a separate package (microsoft#40184)
1 parent 3f60e53 commit e09b169

50 files changed

Lines changed: 1390 additions & 2589 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22
* since: v1.9
33
* langs: js
44

5-
Playwright has **experimental** support for Electron automation. You can access electron namespace via:
5+
Playwright supports Electron automation, shipped as a separate package:
66

7-
```js
8-
const { _electron } = require('playwright');
7+
```sh
8+
npm i -D @playwright/electron
99
```
1010

1111
An example of the Electron automation script would be:
1212

1313
```js
14-
const { _electron: electron } = require('playwright');
14+
import { electron } from '@playwright/electron';
1515

1616
(async () => {
1717
// Launch Electron app.
@@ -89,59 +89,5 @@ Specifies environment variables that will be visible to Electron. Defaults to `p
8989

9090
Maximum time in milliseconds to wait for the application to start. Defaults to `30000` (30 seconds). Pass `0` to disable timeout.
9191

92-
### option: Electron.launch.acceptdownloads = %%-context-option-acceptdownloads-%%
93-
* since: v1.12
94-
95-
### option: Electron.launch.bypassCSP = %%-context-option-bypasscsp-%%
96-
* since: v1.12
97-
98-
### option: Electron.launch.colorScheme = %%-context-option-colorscheme-%%
99-
* since: v1.12
100-
101-
### option: Electron.launch.extraHTTPHeaders = %%-context-option-extrahttpheaders-%%
102-
* since: v1.12
103-
104-
### option: Electron.launch.geolocation = %%-context-option-geolocation-%%
105-
* since: v1.12
106-
107-
### option: Electron.launch.httpcredentials = %%-context-option-httpcredentials-%%
108-
* since: v1.12
109-
110-
### option: Electron.launch.ignoreHTTPSErrors = %%-context-option-ignorehttpserrors-%%
111-
* since: v1.12
112-
113-
### option: Electron.launch.locale = %%-context-option-locale-%%
114-
* since: v1.12
115-
116-
### option: Electron.launch.offline = %%-context-option-offline-%%
117-
* since: v1.12
118-
119-
### option: Electron.launch.recordhar = %%-context-option-recordhar-%%
120-
* since: v1.12
121-
122-
### option: Electron.launch.recordharpath = %%-context-option-recordhar-path-%%
123-
* since: v1.12
124-
125-
### option: Electron.launch.recordHarOmitContent = %%-context-option-recordhar-omit-content-%%
126-
* since: v1.12
127-
128-
### option: Electron.launch.recordvideo = %%-context-option-recordvideo-%%
129-
* since: v1.12
130-
131-
### option: Electron.launch.recordvideodir = %%-context-option-recordvideo-dir-%%
132-
* since: v1.12
133-
134-
### option: Electron.launch.recordvideosize = %%-context-option-recordvideo-size-%%
135-
* since: v1.12
136-
137-
### option: Electron.launch.timezoneId = %%-context-option-timezoneid-%%
138-
* since: v1.12
139-
140-
### option: Electron.launch.tracesDir = %%-browser-option-tracesdir-%%
141-
* since: v1.36
142-
143-
### option: Electron.launch.artifactsDir = %%-browser-option-artifactsdir-%%
144-
* since: v1.59
145-
14692
### option: Electron.launch.chromiumSandbox = %%-browser-option-chromiumsandbox-%%
14793
* since: v1.59
File renamed without changes.

package-lock.json

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/isomorphic/protocolMetainfo.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ export const methodMetainfo = new Map<string, MethodMetainfo>([
7070
['Worker.waitForEventInfo', { title: 'Wait for event "{info.event}"', snapshot: true, }],
7171
['WebSocket.waitForEventInfo', { title: 'Wait for event "{info.event}"', snapshot: true, }],
7272
['Debugger.waitForEventInfo', { title: 'Wait for event "{info.event}"', snapshot: true, }],
73-
['ElectronApplication.waitForEventInfo', { title: 'Wait for event "{info.event}"', snapshot: true, }],
7473
['AndroidDevice.waitForEventInfo', { title: 'Wait for event "{info.event}"', snapshot: true, }],
7574
['BrowserContext.addCookies', { title: 'Add cookies', group: 'configuration', }],
7675
['BrowserContext.addInitScript', { title: 'Add init script', group: 'configuration', }],
@@ -306,11 +305,6 @@ export const methodMetainfo = new Map<string, MethodMetainfo>([
306305
['WritableStream.close', { internal: true, }],
307306
['CDPSession.send', { title: 'Send CDP command', group: 'configuration', }],
308307
['CDPSession.detach', { title: 'Detach CDP session', group: 'configuration', }],
309-
['Electron.launch', { title: 'Launch electron', }],
310-
['ElectronApplication.browserWindow', { internal: true, }],
311-
['ElectronApplication.evaluateExpression', { title: 'Evaluate', }],
312-
['ElectronApplication.evaluateExpressionHandle', { title: 'Evaluate', }],
313-
['ElectronApplication.updateSubscription', { internal: true, }],
314308
['Android.devices', { internal: true, }],
315309
['AndroidSocket.write', { internal: true, }],
316310
['AndroidSocket.close', { internal: true, }],

0 commit comments

Comments
 (0)