project created

This commit is contained in:
2025-07-25 22:03:20 +12:00
parent b80f759df2
commit 1b6c58a348
27 changed files with 211 additions and 5271 deletions
+7 -23
View File
@@ -1,26 +1,10 @@
// preload.js
const { contextBridge, ipcRenderer } = require('electron');
// Expose protected methods that allow the renderer process to use
// the ipcRenderer without exposing the entire object
// Expose a limited set of IPC methods to the renderer process
contextBridge.exposeInMainWorld('electronAPI', {
onIsSteamOS: (callback) => ipcRenderer.on('is-steam-os', (_event, value) => callback(value)),
// Bookmark API
getBookmarks: () => ipcRenderer.invoke('get-bookmarks'),
addBookmark: (bookmark) => ipcRenderer.invoke('add-bookmark', bookmark),
removeBookmark: (url) => ipcRenderer.invoke('remove-bookmark', url),
// Home Bookmark API
getHomeBookmarks: () => ipcRenderer.invoke('get-home-bookmarks'),
addHomeBookmark: (bookmark) => ipcRenderer.invoke('add-home-bookmark', bookmark),
removeHomeBookmark: (url) => ipcRenderer.invoke('remove-home-bookmark', url),
});
contextBridge.exposeInMainWorld('settingsAPI', {
clearCookies: () => ipcRenderer.invoke('clear-cookies'),
goHome: () => ipcRenderer.invoke('go-home'),
clearBookmarks: () => ipcRenderer.invoke('clear-bookmarks'),
clearHomeBookmarks: () => ipcRenderer.invoke('clear-home-bookmarks'),
});
loadURL: (url) => ipcRenderer.send('load-url', url),
goBack: () => ipcRenderer.send('go-back'),
goForward: () => ipcRenderer.send('go-forward'),
refreshPage: () => ipcRenderer.send('refresh-page'),
// You can add more APIs here as your browser grows
});