From fb82baf22dee201bb366624b636704efd616ce92 Mon Sep 17 00:00:00 2001 From: Nicholas Jitkoff Date: Thu, 16 Jun 2022 18:48:41 -0700 Subject: [PATCH] Support rendering from custom domain --- docs/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/index.js b/docs/index.js index cac456d..a3d1f86 100644 --- a/docs/index.js +++ b/docs/index.js @@ -316,7 +316,8 @@ // writeDocContent(iframe.contentWindow.document, SCRIPT_LOADER) // iframe.srcdoc = SCRIPT_LOADER; - let src = location.origin + "/render"; + let src = window.scriptDomain ?? location.origin; + src += "/render"; let sandbox = params.renderer?.sandbox; if (sandbox == "hash") { // Generate sandbox based off of body hash let hash = await bitty.hashString(params.body);