docs: remove references to remote from docs (#25416)
This commit is contained in:
parent
7f885bd266
commit
5de7eb3618
24 changed files with 157 additions and 227 deletions
|
@ -1,23 +1,20 @@
|
|||
const { app, BrowserWindow } = require('electron')
|
||||
const { app, BrowserWindow, ipcMain } = require('electron')
|
||||
|
||||
let mainWindow = null
|
||||
ipcMain.on('create-frameless-window', (event, {url}) => {
|
||||
const win = new BrowserWindow({ frame: false })
|
||||
win.loadURL(url)
|
||||
})
|
||||
|
||||
function createWindow () {
|
||||
const windowOptions = {
|
||||
const mainWindow = new BrowserWindow({
|
||||
width: 600,
|
||||
height: 400,
|
||||
title: 'Create a frameless window',
|
||||
webPreferences: {
|
||||
nodeIntegration: true
|
||||
}
|
||||
}
|
||||
|
||||
mainWindow = new BrowserWindow(windowOptions)
|
||||
mainWindow.loadFile('index.html')
|
||||
|
||||
mainWindow.on('closed', () => {
|
||||
mainWindow = null
|
||||
})
|
||||
mainWindow.loadFile('index.html')
|
||||
}
|
||||
|
||||
app.whenReady().then(() => {
|
||||
|
|
|
@ -1,12 +1,8 @@
|
|||
const { BrowserWindow } = require('electron').remote
|
||||
const { ipcRenderer } = require('electron')
|
||||
|
||||
const newWindowBtn = document.getElementById('frameless-window')
|
||||
|
||||
newWindowBtn.addEventListener('click', (event) => {
|
||||
let win = new BrowserWindow({ frame: false })
|
||||
|
||||
win.on('close', () => { win = null })
|
||||
|
||||
win.loadURL('data:text/html,<h2>Hello World!</h2><a id="close" href="javascript:window.close()">Close this Window</a>')
|
||||
win.show()
|
||||
newWindowBtn.addEventListener('click', () => {
|
||||
const url = 'data:text/html,<h2>Hello World!</h2><a id="close" href="javascript:window.close()">Close this Window</a>'
|
||||
ipcRenderer.send('create-frameless-window', { url })
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue