Comments (10)
@aslushnikov
Hi,
Do you have example to launch from index.js and control the electron using playwright?
from playwright.
@akosyakov: in case you are still interested...
https://www.npmjs.com/package/playwright-electron is now publicly available. It does not have docs, just a bare README.md, but it should be enough to get a rough idea about it. Please let us know what you think!
Edit: Please reference to an up to date guide here: https://playwright.dev/docs/api/class-electron/
from playwright.
Yes, it should be doable by manually hooking up the debugging protocol as corevo says. But Iād really like to have a nicer solution that just works out of the box.
My app is built with electron but it needs to load a certain page in the headless browser and read cookies. I don't want to run another headless browser because electron already has the debugger window. How exactly to "hook up" the debugging protocol?
from playwright.
An electron support is now available with playwright-electron
! š
Edit: Please reference to an up to date guide here: https://playwright.dev/docs/api/class-electron/
from playwright.
I'm assuming you can do it today the same way you would with puppeteer, by enabling the Chrome debugging protocol.
const { app, BrowserWindow } = require('electron')
const puppeteer = require('puppeteer-core')
app.commandLine.appendSwitch('remote-debugging-port', '8315')
const electronBrowser = await puppeteer.connect({
browserURL: 'http://localhost:8315',
})
By just converting the correct puppeteer calls to playwright, I haven't tried it for myself though.
from playwright.
Yes, it should be doable by manually hooking up the debugging protocol as corevo says. But Iād really like to have a nicer solution that just works out of the box.
There are some logistics to work out. Playwright needs to be compatible with the version of electron. Also the way we handle contexts might clash with how electron is implemented. But these both seem like problems that can be overcome.
from playwright.
puppeteer has some issues to support Electron: puppeteer/puppeteer#4283 I was wondering whether it will be the same here.
from playwright.
Folding into #647
from playwright.
@pavelfeldman cool! thanks. Do I understand correctly that it works only against Electron 9?
from playwright.
Yes, Electron 9+ at this point.
from playwright.
Related Issues (20)
- [Feature]: consider to invoke `Emulation.setEmitTouchEventsForMouse` for `isMobile:true` devices HOT 5
- [Feature]: Accessing the expect timeout configuration from custom matcher
- [Bug]: WebGL fails in GitHub Actions on macOS (launcher by Web Test Runner) HOT 1
- [Bug]: HIght CPU usage when using chromium HOT 1
- [Bug]: Starting local server from Playwright is taking longer testing time HOT 2
- [Bug]: Playwright CT 1.43.1 throws Vite/Rollup error when testing MUI HOT 1
- [Feature]: press enter in contenteditable doesn't make keypress code in codegen
- [Bug]: trace stop_chunk. the network in chunk includes the network data from the previous chunk HOT 1
- [Bug]: False Notification: "Host system is missing dependencies to run browsers" HOT 1
- goto method failing with timeout error: HOT 2
- [Feature]: Add APIs to handle open shadow DOMs HOT 3
- [Docs]: Running ui mode docs incomplete HOT 1
- Using storageState in the general use config does not work - but works in the projects array HOT 1
- [Bug]: Exit code 0 when crashes with out of memory error HOT 3
- [Bug]: testIdAttribute via config does not take effect in `globalSetup` function HOT 1
- [Bug]: UI mode is showing tags as pill and as text HOT 2
- [Bug]: ADO Pipeline JUnit Report not showing attachments, however the logs show [[ATTACHMENT|filename]] HOT 3
- [Feature]: Ability to extend the trace information HOT 9
- [Feature]: Add tracing class in page like puppeteer HOT 3
- [Feature]: add page method start record HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright.