GitBucket
4.23.0
Toggle navigation
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
sample-electron
/
sample-electron01
Browse code
fix copypa
master
1 parent
a217621
commit
6bb46159f2041c2d90087b82a7a1b88c22da22d8
yhornisse
authored
on 11 Aug 2021
Patch
Showing
2 changed files
README.md
app/main.js
Ignore Space
Show notes
View
README.md
0 → 100644
## 実行 ```shell $ npm start ``` ## ビルド ```shell $ npm run build ``` ## ビルドしたアプリの実行 ### Macの場合 ```shell $ open dist/Sample-1.0.0-arm64.dmg ``` ### Linuxの場合 ```shell $ sudo chown root ./dist/linux-unpacked/chrome-sandbox $ sudo chmod 4775 ./dist/linux-unpacked/chrome-sandbox $ ./dist/linux-unpacked/electron-sample ```
Ignore Space
Show notes
View
app/main.js
const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; let mainWindow = null; app.on('ready', () => { mainWindow = new BrowserWindow({width: 400, height: 300}); mainWindow.loadURL('file://' + __dirname + '/index.html'); mainWindow.on('closed', function() { mainWindow = null; }); });
const electron = require('electron'); const app = electron.app; const BrowserWindow = electron.BrowserWindow; let mainWindow = null; app.on('ready', () => { // mainWindowを作成(windowの大きさや、Kioskモードにするかどうかなどもここで定義できる) mainWindow = new BrowserWindow({width: 400, height: 300}); // Electronに表示するhtmlを絶対パスで指定(相対パスだと動かない) mainWindow.loadURL('file://' + __dirname + '/index.html'); // ChromiumのDevツールを開く //mainWindow.webContents.openDevTools(); mainWindow.on('closed', function() { mainWindow = null; }); });
Show line notes below