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,25 +1,8 @@
|
|||
const { BrowserWindow } = require('electron').remote
|
||||
const shell = require('electron').shell
|
||||
const { ipcRenderer } = require('electron')
|
||||
|
||||
const framelessWindowBtn = document.getElementById('frameless-window')
|
||||
const newWindowBtn = document.getElementById('frameless-window')
|
||||
|
||||
const links = document.querySelectorAll('a[href]')
|
||||
|
||||
framelessWindowBtn.addEventListener('click', (event) => {
|
||||
const modalPath = 'https://electronjs.org'
|
||||
let win = new BrowserWindow({ frame: false })
|
||||
|
||||
win.on('close', () => { win = null })
|
||||
win.loadURL(modalPath)
|
||||
win.show()
|
||||
})
|
||||
|
||||
Array.prototype.forEach.call(links, (link) => {
|
||||
const url = link.getAttribute('href')
|
||||
if (url.indexOf('http') === 0) {
|
||||
link.addEventListener('click', (e) => {
|
||||
e.preventDefault()
|
||||
shell.openExternal(url)
|
||||
})
|
||||
}
|
||||
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