Commit 0bd97d61 authored by jatuporn Tonggasem's avatar jatuporn Tonggasem

การบ้านที่ 5 ในคาบ

parent 51d083c4
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Hello World!</title>
</head>
<body>
<h1>สวัสดีชาวโลก</h1>
<ol>
<li>We are using node = <script>document.write(process.versions.node)</script></li>
<li>Chrome = <script>document.write(process.versions.chrome)</script></li>
<li>and Electron = <script>document.write(process.versions.electron)</script>.
</li>
</ol>
</body>
</html>
const {app, BrowserWindow} = require('electron')
const path = require('path')
const url = require('url')
let win
function createWindow () {
// Create the browser window.
win = new BrowserWindow({width: 800, height: 600})
// and load the index.html of the app.
win.loadURL(url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',
slashes: true
}))
// Open the DevTools.
win.webContents.openDevTools()
// Emitted when the window is closed.
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()
}
})
This diff is collapsed.
{
"name": "windowapp",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"app": "./node_modules/electron/dist/electron .",
"test": "echo \"Error: no test specified\" && exit 1",
"echo": "touch สวัสดี",
"touch": "echo สวัสดี",
"อันตราย": "rm -rf *"
},
"author": "Tlex",
"license": "ISC",
"devDependencies": {
"electron": "^1.8.2"
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment