OLD | NEW |
(Empty) | |
| 1 <script> |
| 2 |
| 3 var devtoolsTabEvents = undefined; |
| 4 |
| 5 function tabUrlChangeListener() { |
| 6 receivedEvents.push("onTabUrlChange"); |
| 7 } |
| 8 |
| 9 function pageEventListener() { |
| 10 receivedEvents.push("onPageEvent"); |
| 11 } |
| 12 |
| 13 function tabCloseListener() { |
| 14 receivedEvents.push("onTabClose"); |
| 15 } |
| 16 |
| 17 function registerListenersForTab(tabId) { |
| 18 devtoolsTabEvents = chrome.devtools.getTabEvents(tabId); |
| 19 devtoolsTabEvents.onPageEvent.addListener(pageEventListener); |
| 20 devtoolsTabEvents.onTabUrlChange.addListener(tabUrlChangeListener); |
| 21 devtoolsTabEvents.onTabClose.addListener(tabCloseListener); |
| 22 window.domAutomationController.send(true); |
| 23 } |
| 24 |
| 25 function unregisterListeners() { |
| 26 devtoolsTabEvents.onPageEvent.removeListener(pageEventListener); |
| 27 devtoolsTabEvents.onTabUrlChange.removeListener(tabUrlChangeListener); |
| 28 devtoolsTabEvents.onTabClose.removeListener(tabCloseListener); |
| 29 window.domAutomationController.send(true); |
| 30 } |
| 31 |
| 32 </script> |
OLD | NEW |