@@ -133,23 +133,6 @@ function changeCurrLocation(tabObj, rootNode, index, name) {
133
133
}
134
134
}
135
135
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
-
153
136
/*
154
137
The 'chrome.runtime' API allows a connection to the background service worker (background.js).
155
138
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) => {
265
248
return true ;
266
249
267
250
case 'jumpToSnap' :
251
+ // chrome.debugger.detach({ tabId: tabId });
268
252
// console.log('background.js: jumpToSnap:', getAccessibilityTree(tabId));
269
253
chrome . debugger . attach ( { tabId : tabId } , '1.3' , ( ) => {
270
254
chrome . debugger . sendCommand ( { tabId : tabId } , 'Accessibility.enable' , ( ) => {
@@ -274,6 +258,7 @@ chrome.runtime.onConnect.addListener((port) => {
274
258
{ } ,
275
259
( response ) => {
276
260
console . log ( response ) ;
261
+ chrome . debugger . detach ( { tabId : tabId } ) ;
277
262
} ,
278
263
) ;
279
264
} ) ;
0 commit comments