OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 var devtoolsTabEvents = undefined; |
| 6 |
| 7 function pageEventListener() { |
| 8 receivedEvents.push("onPageEvent"); |
| 9 } |
| 10 |
| 11 function tabCloseListener() { |
| 12 receivedEvents.push("onTabClose"); |
| 13 } |
| 14 |
| 15 function registerListenersForTab(tabId) { |
| 16 devtoolsTabEvents = chrome.devtools.getTabEvents(tabId); |
| 17 devtoolsTabEvents.onPageEvent.addListener(pageEventListener); |
| 18 devtoolsTabEvents.onTabClose.addListener(tabCloseListener); |
| 19 window.domAutomationController.send(true); |
| 20 } |
| 21 |
| 22 function unregisterListeners() { |
| 23 devtoolsTabEvents.onPageEvent.removeListener(pageEventListener); |
| 24 devtoolsTabEvents.onTabClose.removeListener(tabCloseListener); |
| 25 window.domAutomationController.send(true); |
| 26 } |
OLD | NEW |