电子框架:false 不适用于 Raspberry Pi 3 模型 B
Electron frame: false not working on Raspberry Pi 3 model B
通常当我使用 frame: false
时,在像 Windows 这样的平台上,它隐藏了 window 顶部的框架以及按钮。我真的很喜欢这个功能,我想在我的 Raspberry Pi 运行 raspbian 上使用它。
我已将 NPM
更新到最新版本。我也试过 --enable-transparent-visuals --disable-gpu
但它似乎没有用。无论如何,这是我目前的 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();
}
这是我的 package.js:
{
"name": "myApp",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "^1.6.11"
}
}
发现错误,是打字错误。 frame: false 显然应该在window.
的初始化中
通常当我使用 frame: false
时,在像 Windows 这样的平台上,它隐藏了 window 顶部的框架以及按钮。我真的很喜欢这个功能,我想在我的 Raspberry Pi 运行 raspbian 上使用它。
我已将 NPM
更新到最新版本。我也试过 --enable-transparent-visuals --disable-gpu
但它似乎没有用。无论如何,这是我目前的 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();
}
这是我的 package.js:
{
"name": "myApp",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"start": "electron ."
},
"author": "",
"license": "ISC",
"devDependencies": {
"electron": "^1.6.11"
}
}
发现错误,是打字错误。 frame: false 显然应该在window.
的初始化中