Skip to content

Commit

Permalink
#8141: Ignore updateDynamicElement in iframes for actionPanel (#8226
Browse files Browse the repository at this point in the history
)
  • Loading branch information
fregante authored Apr 11, 2024
1 parent b59631d commit 59c0941
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/contentScript/pageEditor/dynamic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -102,6 +103,15 @@ export async function updateDynamicElement({
}: DynamicDefinition): Promise<void> {
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
Expand Down

0 comments on commit 59c0941

Please sign in to comment.