diff --git a/src/components/Editor/Project/ScratchContainer.jsx b/src/components/Editor/Project/ScratchContainer.jsx index d422371ee..64117341c 100644 --- a/src/components/Editor/Project/ScratchContainer.jsx +++ b/src/components/Editor/Project/ScratchContainer.jsx @@ -124,6 +124,7 @@ export default function ScratchContainer() { className="scratch-container__iframe" src={iframeSrcUrl} title={"Scratch"} + allow="camera; microphone" style={{ width: "100%", minWidth: `${SCRATCH_MIN_WIDTH}px`, diff --git a/src/components/Editor/Project/ScratchContainer.test.js b/src/components/Editor/Project/ScratchContainer.test.js index d25ec8dfe..ea31a3104 100644 --- a/src/components/Editor/Project/ScratchContainer.test.js +++ b/src/components/Editor/Project/ScratchContainer.test.js @@ -137,6 +137,9 @@ describe("ScratchContainer", () => { ); expect(viewport).toHaveClass("scratch-container__viewport"); expect(iframe).toBeInTheDocument(); + const allow = iframe.getAttribute("allow") ?? ""; + expect(allow).toEqual(expect.stringContaining("camera")); + expect(allow).toEqual(expect.stringContaining("microphone")); expect(iframe).toHaveStyle({ minWidth: "1024px", });