mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-11-27 09:25:06 +01:00
Disable CSP in Khoj Obsidian as it interferes with Obsidian functionality
The Khoj CSP interferes with other Obsidian features and plugins as CSP is applied page wide. For now chat message sanitization via Dompurify should suffice. Enable CSP when can scope it to only the Khoj Obsidian plugin.
This commit is contained in:
parent
a353d883a0
commit
69c9e8cc08
1 changed files with 3 additions and 2 deletions
|
@ -96,8 +96,9 @@ export class KhojChatView extends KhojPaneView {
|
|||
const objectSrc = `object-src 'none';`;
|
||||
const csp = `${defaultSrc} ${scriptSrc} ${connectSrc} ${styleSrc} ${imgSrc} ${childSrc} ${objectSrc}`;
|
||||
|
||||
// Add CSP meta tag to the Khoj Chat modal
|
||||
document.head.createEl("meta", { attr: { "http-equiv": "Content-Security-Policy", "content": `${csp}` } });
|
||||
// WARNING: CSP DISABLED for now as it breaks other Obsidian plugins. Enable when can scope CSP to only Khoj plugin.
|
||||
// CSP meta tag for the Khoj Chat modal
|
||||
// document.head.createEl("meta", { attr: { "http-equiv": "Content-Security-Policy", "content": `${csp}` } });
|
||||
|
||||
// Create area for chat logs
|
||||
let chatBodyEl = contentEl.createDiv({ attr: { id: "khoj-chat-body", class: "khoj-chat-body" } });
|
||||
|
|
Loading…
Reference in a new issue