feat(attachments,security): migrate attachment processing to web worker and update CORS policy
- Add web worker for PDF attachment processing to improve performance and prevent UI blocking - Create add-attachments.worker.js with TypeScript definitions for type safety - Implement worker message handling with success and error responses - Update nginx.conf to use Cross-Origin-Resource-Policy instead of Cross-Origin-Embedder-Policy for better cross-origin resource sharing - Refactor add-attachments.ts to use worker-based processing with transferable objects - Update main.ts to add home logo click handler for navigation - Improve error handling with worker error event listener - Add validation checks for PDF file availability before processing attachments
This commit is contained in:
20
public/workers/add-attachments.worker.d.ts
vendored
Normal file
20
public/workers/add-attachments.worker.d.ts
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
declare const coherentpdf: typeof import('../../src/types/coherentpdf.global').coherentpdf;
|
||||
|
||||
interface AddAttachmentsMessage {
|
||||
command: 'add-attachments';
|
||||
pdfBuffer: ArrayBuffer;
|
||||
attachmentBuffers: ArrayBuffer[];
|
||||
attachmentNames: string[];
|
||||
}
|
||||
|
||||
interface AddAttachmentsSuccessResponse {
|
||||
status: 'success';
|
||||
modifiedPDF: ArrayBuffer;
|
||||
}
|
||||
|
||||
interface AddAttachmentsErrorResponse {
|
||||
status: 'error';
|
||||
message: string;
|
||||
}
|
||||
|
||||
type AddAttachmentsResponse = AddAttachmentsSuccessResponse | AddAttachmentsErrorResponse;
|
||||
Reference in New Issue
Block a user