From 59c09411a3d47c3a92c181ce84359ef69534f654 Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Fri, 12 Apr 2024 00:37:24 +0700 Subject: [PATCH] #8141: Ignore `updateDynamicElement` in iframes for `actionPanel` (#8226) --- src/contentScript/pageEditor/dynamic.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/contentScript/pageEditor/dynamic.ts b/src/contentScript/pageEditor/dynamic.ts index 47ff58219b..4af43124b5 100644 --- a/src/contentScript/pageEditor/dynamic.ts +++ b/src/contentScript/pageEditor/dynamic.ts @@ -34,6 +34,7 @@ import { type JsonObject } from "type-fest"; import { type SelectorRoot } from "@/types/runtimeTypes"; import { type UUID } from "@/types/stringTypes"; import { $safeFind } from "@/utils/domUtils"; +import { isLoadedInIframe } from "@/utils/iframeUtils"; let _overlay: Overlay | null = null; @@ -102,6 +103,15 @@ export async function updateDynamicElement({ }: DynamicDefinition): Promise { expectContext("contentScript"); + // Iframes should not attempt to control the sidebar + // https://github.com/pixiebrix/pixiebrix-extension/pull/8226 + if ( + isLoadedInIframe() && + extensionPointConfig.definition.type === "actionPanel" + ) { + return; + } + // HACK: adjust behavior when using the Page Editor if (extensionPointConfig.definition.type === "trigger") { // Prevent auto-run of interval trigger when using the Page Editor because you lose track of trace across runs