Skip to content

Commit dd81c7b

Browse files
committed
added trigger
1 parent 6664123 commit dd81c7b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/backend/routers/linkFiber.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,17 @@ export default function linkFiber(mode: Status): () => Promise<void> {
133133
// Obtain the updated FiberRootNode, after the target React application re-renders
134134
const fiberRoot = args[1];
135135
// If the target React application is visible, send a request to update the snapShot tree displayed on Chrome Extension
136-
if (isVisible) throttledUpdateSnapshot(fiberRoot, mode);
136+
if (isVisible) {
137+
throttledUpdateSnapshot(fiberRoot, mode);
138+
// SEND COMMAND TO FRONT END TO GET NEW AX TREE
139+
window.postMessage(
140+
{
141+
action: 'recordAXSnap',
142+
payload: 'recordAXSnap',
143+
},
144+
'*',
145+
);
146+
}
137147
// After our added work is completed we invoke the original onComitFiberRoot function
138148
return onCommitFiberRoot(...args);
139149
};

src/extension/contentScript.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ window.addEventListener('message', (msg) => {
3636
if (action === 'aReactApp') {
3737
chrome.runtime.sendMessage(msg.data);
3838
}
39+
if (action === 'recordAXSnap') {
40+
// chrome.runtime.sendMessage()
41+
}
3942
});
4043

4144
// FROM BACKGROUND TO CONTENT SCRIPT

0 commit comments

Comments
 (0)