From 4b254f4c46669c3e8e6e548440ed2edc25a2727d Mon Sep 17 00:00:00 2001
From: Xiao Gui <xgui3783@gmail.com>
Date: Mon, 5 Dec 2022 21:00:47 +0100
Subject: [PATCH] bugfix: plugin postmessage

---
 src/plugin/pluginPortal/pluginPortal.component.ts | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/plugin/pluginPortal/pluginPortal.component.ts b/src/plugin/pluginPortal/pluginPortal.component.ts
index 0b894de55..46f662e7a 100644
--- a/src/plugin/pluginPortal/pluginPortal.component.ts
+++ b/src/plugin/pluginPortal/pluginPortal.component.ts
@@ -10,13 +10,15 @@ import { getPluginSrc, SET_PLUGIN_NAME } from "../const";
 /**
  * sandbox attribute must be set statically
  * see https://angular.io/errors/NG0910
+ * 
+ * allow-same-origin is needed in order for postmessage to work
  */
 
 @Component({
   selector: 'sxplr-plugin-portal',
   template: `
   <iframe [src]="src | iframeSrc"
-    sandbox="allow-downloads allow-popups allow-popups-to-escape-sandbox allow-scripts"
+    sandbox="allow-same-origin allow-downloads allow-popups allow-popups-to-escape-sandbox allow-scripts"
     #iframe>
   </iframe>
   `,
-- 
GitLab