mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-08 16:57:14 +01:00
feat(security,build): add COOP/COEP headers and improve PDF viewer initialization
- Add Cross-Origin-Opener-Policy and Cross-Origin-Embedder-Policy headers to nginx.conf for enhanced security - Create serve.json configuration file with security headers for local development - Update npm scripts to use vite preview instead of serve package for consistency - Fix PDF viewer file parameter handling to prevent fallback to default URL - Enable annotation editor mode by default in PDF viewers (annotationEditorMode: 1) - Improve PDF preference management by clearing conflicting annotation editor settings before loading - Update iframe URL construction to use URL API for proper origin handling - Refactor annotation viewer setup to use eventBus for stamp button activation instead of direct DOM manipulation - Add localStorage preference configuration for signature editor and permissions in sign tool - Enhance security posture by implementing COOP/COEP headers required for SharedArrayBuffer and cross-origin isolation
This commit is contained in:
1 parent
720a14c305
commit
1e557d5b2a
14 files changed
+196
-34
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import packageJson from '../package.json';
|
||||
|
||||
export const APP_VERSION = packageJson.version;
|
||||
|
||||
export function injectVersion() {
|
||||
const versionElements = document.querySelectorAll('#app-version, #app-version-simple');
|
||||
versionElements.forEach((element) => {
|
||||
element.textContent = APP_VERSION;
|
||||
});
|
||||
}
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
if (document.readyState === 'loading') {
|
||||
document.addEventListener('DOMContentLoaded', injectVersion);
|
||||
} else {
|
||||
injectVersion();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user