Issue
Usually when I use frame: false
, on a platform like Windows it hides the frame on top of the window as well as the buttons. I really like this functionality and I'd like to use it on my Raspberry Pi running raspbian.
I have updated NPM
to it's latest version. I've also tried --enable-transparent-visuals --disable-gpu
but it didn't seem to work. Anyway, here is my current main.js:
const {app, BrowserWindow} = require('electron');
const path = require('path');
const url = require('url');
let win;
function createWindow () {
win = new BrowserWindow({width: 800, height: 600});
win.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true,
frame: false
}));
win.webContents.openDevTools();
win.on('closed', () => {
win = null;
})
}
app.on('ready', createWindow);
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
app.on('activate', () => {
if (win === null) {
createWindow();
}
And here is my package.js:
{
"name": "myApp",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "^1.6.11"
}
}
Solution
Found the error, it was a typo. The frame: false should obviously be in the initialization of the window.
Answered By - Spearmint