Commit 4d931bc8 authored by Littichai Buddaken's avatar Littichai Buddaken

week05 ขอ 5 คะแนนครับ

parent 3cdc7408
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>สวัสดี</title>
</head>
<body>
<h1>สวัสดี</h1>
<ol>
<li>เราใช้ 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')
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
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
}))
win.on('closed', () => {
win = null
})
}
app.on('ready', createWindow)
This diff is collapsed.
{
"name": "windowapp",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"app" : "./node_modules/electron/dist/electron .",
"echo": "touch สวัสดี",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Four",
"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