feat: allow chrome extension

This commit is contained in:
Nevo David 2025-05-16 15:11:52 +07:00
parent 8513f093f7
commit 006a9a644f
1 changed files with 26 additions and 0 deletions

View File

@ -1,5 +1,18 @@
// @ts-check
const cspHeader = `
default-src 'self' chrome-extension:;
script-src 'self' 'unsafe-eval' 'unsafe-inline' chrome-extension:;
style-src 'self' 'unsafe-inline' chrome-extension:;
img-src 'self' blob: data: chrome-extension:;
font-src 'self' chrome-extension:;
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
upgrade-insecure-requests;
`;
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
@ -19,6 +32,19 @@ const nextConfig = {
},
],
},
async headers() {
return [
{
source: '/(.*)',
headers: [
{
key: 'Content-Security-Policy',
value: cspHeader.replace(/\n/g, ''),
},
],
},
];
},
async redirects() {
return [
{