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 // Called when the url of a tab changes. |
| 6 function checkForValidUrl(tabId, changeInfo, tab) { |
| 7 // If the letter 'g' is found in the tab's URL... |
| 8 if (tab.url.indexOf('g') > -1) { |
| 9 // ... show the page action. |
| 10 chrome.pageAction.show(tabId); |
| 11 } |
| 12 }; |
| 13 |
| 14 // Listen for any changes to the URL of any tab. |
| 15 chrome.tabs.onUpdated.addListener(checkForValidUrl); |
OLD | NEW |