mirror of
https://github.com/electron/electron.git
synced 2026-01-10 07:58:08 -05:00
chore: lint code blocks in docs with ESLint (#42113)
This commit is contained in:
@@ -40,6 +40,7 @@ the window after this event will have no visual flash:
|
||||
|
||||
```js
|
||||
const { BrowserWindow } = require('electron')
|
||||
|
||||
const win = new BrowserWindow({ show: false })
|
||||
win.once('ready-to-show', () => {
|
||||
win.show()
|
||||
@@ -373,6 +374,7 @@ e.g. `APPCOMMAND_BROWSER_BACKWARD` is emitted as `browser-backward`.
|
||||
|
||||
```js
|
||||
const { BrowserWindow } = require('electron')
|
||||
|
||||
const win = new BrowserWindow()
|
||||
win.on('app-command', (e, cmd) => {
|
||||
// Navigate the window back when the user hits their mouse back button
|
||||
@@ -820,6 +822,7 @@ Resizes and moves the window to the supplied bounds. Any properties that are not
|
||||
|
||||
```js
|
||||
const { BrowserWindow } = require('electron')
|
||||
|
||||
const win = new BrowserWindow()
|
||||
|
||||
// set all bounds properties
|
||||
@@ -1080,6 +1083,7 @@ a HTML-rendered toolbar. For example:
|
||||
|
||||
```js
|
||||
const { BrowserWindow } = require('electron')
|
||||
|
||||
const win = new BrowserWindow()
|
||||
|
||||
const toolbarRect = document.getElementById('toolbar').getBoundingClientRect()
|
||||
@@ -1232,9 +1236,10 @@ method:
|
||||
|
||||
```js
|
||||
const { BrowserWindow } = require('electron')
|
||||
|
||||
const win = new BrowserWindow()
|
||||
|
||||
const url = require('url').format({
|
||||
const url = require('node:url').format({
|
||||
protocol: 'file',
|
||||
slashes: true,
|
||||
pathname: require('node:path').join(__dirname, 'index.html')
|
||||
@@ -1248,6 +1253,7 @@ the following:
|
||||
|
||||
```js
|
||||
const { BrowserWindow } = require('electron')
|
||||
|
||||
const win = new BrowserWindow()
|
||||
|
||||
win.loadURL('http://localhost:8000/post', {
|
||||
|
||||
Reference in New Issue
Block a user