Skip to content

Commit d59c143

Browse files
committed
removed window message for recordAXSnap and instead piggy back on recordSnap functionality
1 parent e3a1236 commit d59c143

File tree

3 files changed

+15
-26
lines changed

3 files changed

+15
-26
lines changed

src/backend/routers/linkFiber.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,14 +135,6 @@ export default function linkFiber(mode: Status): () => Promise<void> {
135135
// If the target React application is visible, send a request to update the snapShot tree displayed on Chrome Extension
136136
if (isVisible) {
137137
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-
);
146138
}
147139
// After our added work is completed we invoke the original onComitFiberRoot function
148140
return onCommitFiberRoot(...args);

src/extension/background.js

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -304,19 +304,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
304304
}
305305
switch (action) {
306306
case 'recordAXSnap': {
307-
chrome.debugger.attach({ tabId: tabId }, '1.3', () => {
308-
chrome.debugger.sendCommand({ tabId: tabId }, 'Accessibility.enable', () => {
309-
chrome.debugger.sendCommand(
310-
{ tabId: tabId },
311-
'Accessibility.getFullAXTree',
312-
{},
313-
(response) => {
314-
console.log(response);
315-
chrome.debugger.detach({ tabId: tabId });
316-
},
317-
);
318-
});
319-
});
320307
}
321308
case 'attemptReconnect': {
322309
const success = 'portSuccessfullyConnected';
@@ -417,6 +404,21 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
417404
sendToHierarchy(tabsObj[tabId], new HistoryNode(request.payload, tabsObj[tabId]));
418405
}
419406
}
407+
408+
chrome.debugger.attach({ tabId: tabId }, '1.3', () => {
409+
chrome.debugger.sendCommand({ tabId: tabId }, 'Accessibility.enable', () => {
410+
chrome.debugger.sendCommand(
411+
{ tabId: tabId },
412+
'Accessibility.getFullAXTree',
413+
{},
414+
(response) => {
415+
console.log(response);
416+
chrome.debugger.detach({ tabId: tabId });
417+
},
418+
);
419+
});
420+
});
421+
420422
// sends new tabs obj to devtools
421423
if (portsArr.length > 0) {
422424
portsArr.forEach((bg) =>

src/extension/contentScript.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,6 @@ window.addEventListener('message', (msg) => {
3636
if (action === 'aReactApp') {
3737
chrome.runtime.sendMessage(msg.data);
3838
}
39-
if (action === 'recordAXSnap') {
40-
console.log('contentScript.ts: window received recordAXSnap');
41-
// chrome.runtime.sendMessage({ action: 'recordAXSnap' });
42-
chrome.runtime.sendMessage(msg.data);
43-
}
4439
});
4540

4641
// FROM BACKGROUND TO CONTENT SCRIPT

0 commit comments

Comments
 (0)