MCPcopy Create free account
hub / github.com/dailydotdev/apps / createFrameCleanupController

Function createFrameCleanupController

packages/extension/src/frame/controller.ts:62–84  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60};
61
62export const createFrameCleanupController = () => {
63 let shouldDisableEmbeddingOnCleanup = false;
64
65 return {
66 markEmbeddingEnabled() {
67 // Only tear the rule down if this frame was the one that enabled it.
68 shouldDisableEmbeddingOnCleanup = true;
69 },
70 async disableEmbeddingForTab() {
71 if (!shouldDisableEmbeddingOnCleanup) {
72 return;
73 }
74
75 shouldDisableEmbeddingOnCleanup = false;
76
77 try {
78 await disableFrameEmbeddingViaBackground();
79 } catch (error) {
80 errorLog('[frame] failed to disable frame embedding for tab:', error);
81 }
82 },
83 };
84};
85
86export const initializeFrame = async ({
87 root,

Callers 1

index.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected