mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Fix some csp issues
This commit is contained in:
@@ -29,6 +29,11 @@ Alpine.data('tinyMceEditor', () => ({
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://cdn.tiny.cloud/1/' + apiKey + '/tinymce/8/tinymce.min.js';
|
||||
script.referrerPolicy = 'origin';
|
||||
// Add CSP nonce for Content Security Policy compliance
|
||||
const nonceMeta = document.querySelector('meta[name="csp-nonce"]');
|
||||
if (nonceMeta) {
|
||||
script.nonce = nonceMeta.content;
|
||||
}
|
||||
script.onload = () => this._doInit();
|
||||
script.onerror = () => {
|
||||
document.querySelectorAll('#body, .tinymce-editor').forEach(ta => {
|
||||
|
||||
@@ -1195,6 +1195,11 @@ document.querySelectorAll('.progress-bar').forEach(bar => {
|
||||
const script = document.createElement('script');
|
||||
script.src = 'https://cdn.tiny.cloud/1/' + apiKey + '/tinymce/7/tinymce.min.js';
|
||||
script.referrerPolicy = 'origin';
|
||||
// Add CSP nonce for Content Security Policy compliance
|
||||
const nonceMeta = document.querySelector('meta[name="csp-nonce"]');
|
||||
if (nonceMeta) {
|
||||
script.nonce = nonceMeta.content;
|
||||
}
|
||||
script.onload = doInit;
|
||||
script.onerror = function() { console.error('Failed to load TinyMCE'); };
|
||||
document.head.appendChild(script);
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
|
||||
<!-- TinyMCE API Key -->
|
||||
<meta name="tinymce-api-key" content="{{ config('tinymce.api_key', 'no-api-key') }}">
|
||||
|
||||
<!-- CSP Nonce for dynamic script loading -->
|
||||
<meta name="csp-nonce" content="{{ csp_nonce() }}">
|
||||
</head>
|
||||
<body class="bg-gray-100 dark:bg-gray-900 font-sans antialiased transition-colors duration-200">
|
||||
<div class="h-screen flex">
|
||||
|
||||
@@ -15,6 +15,8 @@
|
||||
|
||||
<!-- Theme Preference - Set via meta tag for CSP compliance -->
|
||||
<meta name="theme-preference" content="{{ auth()->check() ? (auth()->user()->theme_preference ?? 'light') : 'light' }}">
|
||||
<!-- CSP Nonce for dynamic script loading -->
|
||||
<meta name="csp-nonce" content="{{ csp_nonce() }}">
|
||||
@auth
|
||||
<meta name="user-authenticated" content="true">
|
||||
<meta name="update-theme-url" content="{{ route('profile.update-theme') }}">
|
||||
|
||||
Reference in New Issue
Block a user