@@ -133,23 +133,6 @@ function changeCurrLocation(tabObj, rootNode, index, name) {
133133 }
134134}
135135
136- // get ax tree
137- // function getAccessibilityTree(tabId) {
138- // chrome.debugger.attach({ tabId: tabId }, '1.3', function () {
139- // chrome.debugger.sendCommand({ tabId: tabId }, '1.3', 'Accessibility.enable', {}, function () {
140- // chrome.debugger.sendCommand(
141- // { tabId: tabId },
142- // '1.3',
143- // 'Accessibility.getFullAxTree',
144- // {},
145- // function (response) {
146- // console.log(response);
147- // },
148- // );
149- // });
150- // });
151- // }
152-
153136/*
154137 The 'chrome.runtime' API allows a connection to the background service worker (background.js).
155138 This allows us to set up listener's for when we connect, message, and disconnect the script.
@@ -265,6 +248,7 @@ chrome.runtime.onConnect.addListener((port) => {
265248 return true ;
266249
267250 case 'jumpToSnap' :
251+ // chrome.debugger.detach({ tabId: tabId });
268252 // console.log('background.js: jumpToSnap:', getAccessibilityTree(tabId));
269253 chrome . debugger . attach ( { tabId : tabId } , '1.3' , ( ) => {
270254 chrome . debugger . sendCommand ( { tabId : tabId } , 'Accessibility.enable' , ( ) => {
@@ -274,6 +258,7 @@ chrome.runtime.onConnect.addListener((port) => {
274258 { } ,
275259 ( response ) => {
276260 console . log ( response ) ;
261+ chrome . debugger . detach ( { tabId : tabId } ) ;
277262 } ,
278263 ) ;
279264 } ) ;
0 commit comments