Add 'Save Image As...' to context menu and image saving support

Introduces a 'Save Image As...' option to the context menu for images. Implements IPC handlers in main and preload scripts to save images from URLs, data URLs, and file URLs. Updates renderer logic to handle saving images from various sources, including blob URLs via webview conversion.
This commit is contained in:
2025-08-15 18:53:15 +12:00
parent f319384fdc
commit 38972b0f35
3 changed files with 96 additions and 3 deletions
+3 -1
View File
@@ -70,7 +70,9 @@ const electronAPI = {
} catch (err) {
console.error('IPC showContextMenu error:', err);
}
}
},
saveImageToDisk: async (suggestedName, dataUrl) => ipcRenderer.invoke('save-image-from-dataurl', { suggestedName, dataUrl }),
saveImageFromNet: async (url) => ipcRenderer.invoke('save-image-from-url', { url })
};
// Cache for bookmarks to reduce IPC calls