Skip to content

Instantly share code, notes, and snippets.

@t57ser
Created October 20, 2023 06:52
Show Gist options
  • Save t57ser/0bff361397c8eba35317af8ecdc540eb to your computer and use it in GitHub Desktop.
Save t57ser/0bff361397c8eba35317af8ecdc540eb to your computer and use it in GitHub Desktop.
Electron transparency issue
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
CLICK ME
</body>
</html>
let { app, BrowserWindow } = require("electron")
function createWindow() {
let win2 = new BrowserWindow({
frame: false,
transparent: true,
})
win2.loadFile("index.html").then(() => {
win2.webContents.openDevTools({mode: "detach"})
}).catch(console.log);
}
app.on("ready", createWindow)
app.on("window-all-closed", () => {
app.quit()
})
{
"main": "main.js",
"scripts": {
"start": "electron ."
},
"devDependencies": {
"electron": "27.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment