OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 __telemetry_spawned_tabs = []; |
| 6 |
| 7 function __telemetry_spawn_tab() { |
| 8 var tab = window.open(window.location.href); |
| 9 if (typeof tab === "undefined") { |
| 10 throw "Cannot open tab. Forgot --disable-popup-blocking flag?"; |
| 11 } |
| 12 __telemetry_spawned_tabs.push(tab); |
| 13 return __telemetry_spawned_tabs.length - 1; |
| 14 } |
| 15 |
| 16 function __telemetry_close_tab(tab) { |
| 17 __telemetry_spawned_tabs[tab].close(); |
| 18 __telemetry_spawned_tabs[tab] = null; |
| 19 } |
OLD | NEW |