1 // Copyright (c) 2012 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 chrome
.cookies
.onChanged
.addListener(function(info
) {
6 console
.log("onChanged" + JSON
.stringify(info
));
9 function focusOrCreateTab(url
) {
10 chrome
.windows
.getAll({"populate":true}, function(windows
) {
11 var existing_tab
= null;
12 for (var i
in windows
) {
13 var tabs
= windows
[i
].tabs
;
23 chrome
.tabs
.update(existing_tab
.id
, {"selected":true});
25 chrome
.tabs
.create({"url":url
, "selected":true});
30 chrome
.browserAction
.onClicked
.addListener(function(tab
) {
31 var manager_url
= chrome
.extension
.getURL("manager.html");
32 focusOrCreateTab(manager_url
);