week5

parent 2edf5d49
<!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>และ 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 creatWindow() {
win = new BrowserWindow({width: 800,height: 600})
win.loadURL(
url.format({
pathname: path.join(__dirname, 'index.html'),
protocol: 'file:',//'http:'
slashes: true
})
)
win.on('close',()=>{
win = null
})
}
app.on("ready",creatWindow)
This diff is collapsed.
{
"name": "windowapp",
"version": "1.0.0",
"description": "",
"main": "main.js",
"scripts": {
"app": "./node_modules/electron/dist/electron .",
"อันตราย": "rm -rf *",
"touch": "touch สวัสดี",
"echo": "echo สวัสดี",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "teerapong.wo",
"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