]>
Commit | Line | Data |
---|---|---|
1 | // Copyright 2014 The Chromium OS 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 storage = chrome.storage.local; | |
6 | ||
7 | // When visiting a waterfall page, show the icon. | |
8 | console.log('going...'); | |
9 | chrome.webNavigation.onCommitted.addListener(function(e) { | |
10 | setIcon(e.tabId); | |
11 | }, {url: [{hostEquals: 'uberchromegw.corp.google.com'}, | |
12 | {hostEquals: 'chromegw.corp.google.com'}]}); | |
13 | ||
14 | function onClicked(tab) { | |
15 | if (window.confirm('nuke them all?')) { | |
16 | chrome.tabs.executeScript(tab.id, { | |
17 | 'file': 'click_all.js' | |
18 | }); | |
19 | } | |
20 | } | |
21 | ||
22 | chrome.pageAction.onClicked.addListener(onClicked); | |
23 | ||
24 | function setIcon(tabId) { | |
25 | //chrome.pageAction.setPopup({'tabId':tabId, 'popup':'popup.html'}); | |
26 | chrome.pageAction.setIcon({'tabId':tabId, 'path':'icon-96x96.png'}); | |
27 | chrome.pageAction.setTitle({'tabId':tabId, 'title':'Nuke It'}); | |
28 | chrome.pageAction.show(tabId); | |
29 | } |