Created
October 20, 2023 06:52
-
-
Save t57ser/0bff361397c8eba35317af8ecdc540eb to your computer and use it in GitHub Desktop.
Electron transparency issue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Title</title> | |
</head> | |
<body> | |
CLICK ME | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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