Add plugin system with sample plugin and settings UI
Introduces a plugin architecture, including a PluginManager, plugin loading in main and renderer processes, and a sample plugin demonstrating menu, IPC, and context menu contributions. Adds a Plugins tab to the settings UI for managing plugins (enable/disable, reload), and updates preload.js to load renderer preloads from plugins. Documentation for plugin development is included in README-PLUGINS.md.
This commit is contained in:
@@ -1101,6 +1101,15 @@ function updateZoomUI() {
|
||||
function zoomIn() { ipcRenderer.invoke('zoom-in').then(updateZoomUI); }
|
||||
function zoomOut() { ipcRenderer.invoke('zoom-out').then(updateZoomUI); }
|
||||
|
||||
// Optional: sample plugin demo hook (safe if plugin missing)
|
||||
try {
|
||||
if (window.sampleHello && typeof window.sampleHello.onHello === 'function') {
|
||||
window.sampleHello.onHello((payload) => {
|
||||
console.log('[Sample Plugin] Hello message:', payload);
|
||||
});
|
||||
}
|
||||
} catch {}
|
||||
|
||||
// Utility: close the menu when interacting with a given element (e.g., webview)
|
||||
function attachCloseMenuOnInteract(el) {
|
||||
if (!el) return;
|
||||
|
||||
Reference in New Issue
Block a user