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.
5 __telemetry_spawned_tabs = [];
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?";
12 __telemetry_spawned_tabs.push(tab);
13 return __telemetry_spawned_tabs.length - 1;
16 function __telemetry_close_tab(tab) {
17 __telemetry_spawned_tabs[tab].close();
18 __telemetry_spawned_tabs[tab] = null;