ceea1225a2
* docs: add fiddle example * docs: add tutorial guide * refactor: PR review comments * refactor: add eof * refactor: render navigation history and make demo better. * refactor: fix broken links * refactor: add eof newline * docs: review feedback :) * chore: lint add space around list * doc: transformURL
12 lines
590 B
JavaScript
12 lines
590 B
JavaScript
const { contextBridge, ipcRenderer } = require('electron')
|
|
|
|
contextBridge.exposeInMainWorld('electronAPI', {
|
|
goBack: () => ipcRenderer.invoke('nav:back'),
|
|
goForward: () => ipcRenderer.invoke('nav:forward'),
|
|
canGoBack: () => ipcRenderer.invoke('nav:canGoBack'),
|
|
canGoForward: () => ipcRenderer.invoke('nav:canGoForward'),
|
|
loadURL: (url) => ipcRenderer.invoke('nav:loadURL', url),
|
|
getCurrentURL: () => ipcRenderer.invoke('nav:getCurrentURL'),
|
|
getHistory: () => ipcRenderer.invoke('nav:getHistory'),
|
|
onNavigationUpdate: (callback) => ipcRenderer.on('nav:updated', callback)
|
|
})
|