Use path.join when logging screenshot path. (#29211)
Remove index.html from offscreen-rendering tutorial. It is not used. Update offscreen-rendering.md to reflect changes to fiddle.
This commit is contained in:
parent
77e7d828ee
commit
7209702278
3 changed files with 3 additions and 21 deletions
|
@ -1,15 +0,0 @@
|
|||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Hello World!</title>
|
||||
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
|
||||
</head>
|
||||
<body>
|
||||
<h1>Hello World!</h1>
|
||||
<p>
|
||||
We are using node <script>document.write(process.versions.node)</script>,
|
||||
Chrome <script>document.write(process.versions.chrome)</script>,
|
||||
and Electron <script>document.write(process.versions.electron)</script>.
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
|
@ -1,5 +1,6 @@
|
|||
const { app, BrowserWindow } = require('electron')
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
app.disableHardwareAcceleration()
|
||||
|
||||
|
@ -12,7 +13,7 @@ app.whenReady().then(() => {
|
|||
fs.writeFileSync('ex.png', image.toPNG())
|
||||
})
|
||||
win.webContents.setFrameRate(60)
|
||||
console.log(`The screenshot has been successfully saved to ${process.cwd()}/ex.png`)
|
||||
console.log(`The screenshot has been successfully saved to ${path.join(process.cwd(), 'ex.png')}`)
|
||||
})
|
||||
|
||||
app.on('window-all-closed', () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue