mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-03 02:11:07 +05:30
fix: resolve 12 critical runtime failures, security issue, and dead code
CRITICAL fixes:
- GitStatusPanel: use ipc.file.gitStage/gitCommit instead of non-existent top-level methods
- HeaderFooterDialog: use send/on channels instead of non-existent headerFooter namespace
- CodeMirrorEditor: use invoke('save-pasted-image') instead of non-existent savePastedImage
- ipc.ts: map to correct preload namespaces (git.status, git.stage, git.commit)
- Add pick-folder/pick-file to ALLOWED_SEND_CHANNELS whitelist
- Add git convenience namespace to preload (git.status/stage/commit/log/diff)
HIGH fixes:
- FindReplaceBar: replace broken match count stub with regex-based counter
- PDF export window: disable nodeIntegration, enable contextIsolation + sandbox
- Git handler: accept rootPath argument from renderer
- Add git-diff IPC handler + GitOperations.diff()
MEDIUM fixes:
- Remove 4 dead functions: checkPandocAvailable, safeExecFile, runPandoc, openPDFFile, exportWithPandocPDF
- Remove stale ODT header/footer console.log stub
- Rewrite electron.d.ts to match actual preload API shape
This commit is contained in:
@@ -105,6 +105,8 @@ const ALLOWED_SEND_CHANNELS = [
|
||||
'is-directory',
|
||||
'copy-path',
|
||||
'move-path',
|
||||
'pick-folder',
|
||||
'pick-file',
|
||||
|
||||
// Git
|
||||
'git-status',
|
||||
@@ -460,6 +462,15 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
|
||||
getAppVersion: () => ipcRenderer.invoke('get-app-version'),
|
||||
|
||||
// Git Operations
|
||||
git: {
|
||||
status: (rootPath) => ipcRenderer.invoke('git-status', rootPath),
|
||||
stage: (args) => ipcRenderer.invoke('git-stage', args),
|
||||
commit: (args) => ipcRenderer.invoke('git-commit', args),
|
||||
log: (rootPath) => ipcRenderer.invoke('git-log', rootPath),
|
||||
diff: (filePath) => ipcRenderer.invoke('git-diff', filePath),
|
||||
},
|
||||
|
||||
app: {
|
||||
quit: () => ipcRenderer.send('app:quit'),
|
||||
openExternal: (url) => ipcRenderer.send('app:open-external', url),
|
||||
|
||||
Reference in New Issue
Block a user