You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [ ] Regression (a behavior that used to work and stopped working in a new release)
- [X ] Bug report -> please search issues before submitting
- [ ] Feature request
- [ ] Documentation issue or request
Description:
When a PDF requires WebAssembly and is blocked by Content Security Policy (CSP), the viewer only shows a console warning without triggering any error handlers or providing user feedback.
Current Behavior:
When loading a PDF that requires WebAssembly functionality
If CSP blocks WebAssembly with unsafe-eval restriction
Only a console warning appears:
Warning: Unable to decode image "img_p0_1": "CompileError: WebAssembly.Module(): Refused to compile or instantiate WebAssembly module because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive..."
No error event is emitted
No way to catch this and show user feedback
PDF viewer shows blank page with no error indication
Expected Behavior:
Error should be thrown or error event emitted when WebAssembly is blocked by CSP
Allow error handling through the standard (error) output
Enable developers to show appropriate error messages to users
Impact:
Poor user experience as users see blank PDFs without explanation
No way to gracefully handle this error case in production environments with strict CSP
Forces developers to implement hacky workarounds or modify worker code
Technical Details:
Occurs in PDF.js worker
Warning is logged in warn() function but doesn't propagate to error handlers
Affects environments where CSP restricts unsafe-eval
Suggested Solution:
Convert the WebAssembly CSP warning into a proper error that can be caught through the standard error handling mechanism.
Let me know if you would like me to add or modify anything in this issue.
The text was updated successfully, but these errors were encountered:
Bug Report or Feature Request (mark with an
x
)Description:
When a PDF requires WebAssembly and is blocked by Content Security Policy (CSP), the viewer only shows a console warning without triggering any error handlers or providing user feedback.
Current Behavior:
unsafe-eval
restrictionExpected Behavior:
Impact:
Technical Details:
warn()
function but doesn't propagate to error handlersunsafe-eval
Suggested Solution:
Convert the WebAssembly CSP warning into a proper error that can be caught through the standard error handling mechanism.
Let me know if you would like me to add or modify anything in this issue.
The text was updated successfully, but these errors were encountered: