Skip to content

Commit d9b38f3

Browse files
authored
Merge branch 'pyodide-migration' into issues/936-Spike_Investigate_using_pyodide_dynamically
2 parents e45e8e3 + 5197fac commit d9b38f3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
88

99
### Added
1010

11+
- Support to enable embedding iframes in HTML projects from in-house domains (#985)
1112
- Unit tests for `pyodide` runner (#976)
1213
- Dynamic switching between `pyodide` and `skulpt` based on user imports (#937)
1314

src/components/Editor/Runners/HtmlRunner/HtmlRunner.jsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,8 @@ function HtmlRunner() {
283283
projectFile.content,
284284
mimeTypes.lookup(`${projectFile.name}.${projectFile.extension}`),
285285
);
286+
} else if (matchingRegexes(allowedExternalLinks, srcNode.attrs[attr])) {
287+
src = srcNode.attrs[attr];
286288
}
287289
srcNode.setAttribute(attr, src);
288290
srcNode.setAttribute("crossorigin", true);

src/utils/externalLinkHelper.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ import { useDispatch } from "react-redux";
33

44
import { setError, triggerCodeRun } from "../redux/EditorSlice";
55

6-
const domain = `https://rpf.io/`;
6+
const domain = "https://rpf.io/";
7+
const host = process.env.PUBLIC_URL || "http://localhost:3010";
78
const rpfDomain = new RegExp(`^${domain}`);
9+
const hostDomain = new RegExp(`^${host}`);
810
const allowedInternalLinks = [new RegExp(`^#[a-zA-Z0-9]+`)];
9-
const allowedExternalLinks = [rpfDomain];
11+
const allowedExternalLinks = [rpfDomain, hostDomain];
1012

1113
const useExternalLinkState = (showModal) => {
1214
const dispatch = useDispatch();

0 commit comments

Comments
 (0)