mirror of
https://github.com/amitwh/markdown-converter.git
synced 2026-08-23 23:10:17 +05:30
fix(preload): whitelist word-template IPC channels, drop orphaned set-custom-start-page
This commit is contained in:
+11
-4
@@ -68,13 +68,16 @@ const ALLOWED_SEND_CHANNELS = [
|
||||
'save-header-footer-logo',
|
||||
'clear-header-footer-logo',
|
||||
|
||||
// Word template settings
|
||||
'get-word-template-settings',
|
||||
'save-word-template-settings',
|
||||
'browse-word-template',
|
||||
'clear-word-template',
|
||||
|
||||
// Page settings
|
||||
'get-page-settings',
|
||||
'update-page-settings',
|
||||
|
||||
// Template settings
|
||||
'set-custom-start-page',
|
||||
|
||||
// PDF operations
|
||||
'process-pdf-operation',
|
||||
'get-pdf-page-count',
|
||||
@@ -215,6 +218,11 @@ const ALLOWED_RECEIVE_CHANNELS = [
|
||||
'header-footer-logo-selected',
|
||||
'header-footer-logo-saved',
|
||||
|
||||
// Word template settings
|
||||
'word-template-settings-data',
|
||||
'word-template-browsed',
|
||||
'open-word-template-dialog',
|
||||
|
||||
// Page settings
|
||||
'page-settings-data',
|
||||
|
||||
@@ -414,7 +422,6 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
||||
page: {
|
||||
getSettings: () => ipcRenderer.send('get-page-settings'),
|
||||
updateSettings: (settings) => ipcRenderer.send('update-page-settings', settings),
|
||||
setCustomStartPage: (pageNumber) => ipcRenderer.send('set-custom-start-page', pageNumber),
|
||||
},
|
||||
|
||||
// PDF Operations
|
||||
|
||||
@@ -44,7 +44,6 @@ describe('Preload Security', () => {
|
||||
'clear-header-footer-logo',
|
||||
'get-page-settings',
|
||||
'update-page-settings',
|
||||
'set-custom-start-page',
|
||||
'process-pdf-operation',
|
||||
'get-pdf-page-count',
|
||||
'select-pdf-folder',
|
||||
|
||||
@@ -55,7 +55,6 @@ global.window.electronAPI = {
|
||||
page: {
|
||||
getSettings: jest.fn(),
|
||||
updateSettings: jest.fn(),
|
||||
setCustomStartPage: jest.fn(),
|
||||
},
|
||||
pdf: {
|
||||
processOperation: jest.fn(),
|
||||
|
||||
Reference in New Issue
Block a user