diff --git a/public/app/core/trustedTypePolicies.ts b/public/app/core/trustedTypePolicies.ts index 997e4215194..6dedb7f68e8 100644 --- a/public/app/core/trustedTypePolicies.ts +++ b/public/app/core/trustedTypePolicies.ts @@ -3,27 +3,29 @@ import { config } from '@grafana/runtime'; const CSP_REPORT_ONLY_ENABLED = config.bootData.settings.cspReportOnlyEnabled; +export const defaultTrustedTypesPolicy = { + createHTML: (string: string, source: string, sink: string) => { + if (!CSP_REPORT_ONLY_ENABLED) { + return string.replace(/