A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
editor: fix youtube embeds
Abdullah Atta49ffcbea03d5
diff --git a/packages/editor/src/extensions/embed/component.tsx b/packages/editor/src/extensions/embed/component.tsxindex 6b2ac8ee9..c57b7abd7 100644--- a/packages/editor/src/extensions/embed/component.tsx+++ b/packages/editor/src/extensions/embed/component.tsx@@ -115,10 +115,10 @@ export function EmbedComponent(</Box><Embedref={embedRef}- src={src.startsWith("javascript:") ? "about:blank" : src}+ src={src}width={"100%"}height={"100%"}- sandbox="allow-scripts"+ sandbox={getSandboxFeatures(src)}sx={{bg: "var(--background-secondary)",border: selected@@ -147,3 +147,15 @@ export function EmbedComponent(</Flex>);}++function getSandboxFeatures(src: string) {+ const features = [];+ try {+ const url = new URL(src);+ if (url.protocol === "http:" || url.protocol === "https:")+ features.push("allow-scripts", "allow-same-origin");+ } catch {+ // ignore+ }+ return features.join(" ");+}