Skip to content

Instantly share code, notes, and snippets.

@cpoile
Created April 18, 2023 20:44
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 cpoile/97f08192e630291fcc9ea90e7f5b442f to your computer and use it in GitHub Desktop.
Save cpoile/97f08192e630291fcc9ea90e7f5b442f to your computer and use it in GitHub Desktop.
Electron MAS red transparent window with AMD graphics
<html>
<head>
<style>
body {
width: 100vw;
height: 100vh;
}
</style>
</head>
<body>
</body>
</html>
const electron = require("electron");
electron.app.whenReady().then(() => {
const win = new electron.BrowserWindow({
width: 200,
height: 100,
frame: false,
transparent: true,
webPreferences: {
nodeIntegration: false,
contextIsolation: true,
},
});
win.loadURL(`file://${process.cwd()}/index.html`);
});
{
"name": "abcd",
"productName": "abcd",
"description": "My Electron application description",
"keywords": [],
"main": "./main.js",
"version": "1.0.0",
"author": "cpoile",
"scripts": {
"start": "electron ."
},
"dependencies": {},
"devDependencies": {
"electron": "24.1.2-mas"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment