Skip to content

Instantly share code, notes, and snippets.

@andersk

andersk/index.js Secret

Last active December 15, 2022 07:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andersk/96a04d05e1bd55c2754c514dd547d1e3 to your computer and use it in GitHub Desktop.
Save andersk/96a04d05e1bd55c2754c514dd547d1e3 to your computer and use it in GitHub Desktop.
const { BrowserWindow, app, protocol } = require("electron");
protocol.registerSchemesAsPrivileged([]);
app.whenReady().then(() => {
const win = new BrowserWindow();
win.loadURL("data:text/plain,Hello, world!");
});
app.on("window-all-closed", () => {
app.quit();
});
{
"scripts": {
"test": "node test.js"
},
"dependencies": {
"electron": "^22.0.0",
"playwright-core": "^1.28.1"
}
}
const { _electron } = require("playwright-core");
(async () => {
const app = await _electron.launch({ args: ["."] });
const win = await app.firstWindow();
console.log("text =", await win.innerText(":root"));
app.close();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment