OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 * Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this | 3 * Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this |
4 * source code is governed by a BSD-style license that can be found in the | 4 * source code is governed by a BSD-style license that can be found in the |
5 * LICENSE file. | 5 * LICENSE file. |
6 --> | 6 --> |
7 <html> | 7 <html> |
8 <head> | 8 <head> |
9 <script> | 9 <script src="background.js"></script> |
10 // Called when the url of a tab changes. | |
11 function checkForValidUrl(tabId, changeInfo, tab) { | |
12 // If the letter 'g' is found in the tab's URL... | |
13 if (tab.url.indexOf('g') > -1) { | |
14 // ... show the page action. | |
15 chrome.pageAction.show(tabId); | |
16 } | |
17 }; | |
18 | |
19 // Listen for any changes to the URL of any tab. | |
20 chrome.tabs.onUpdated.addListener(checkForValidUrl); | |
21 </script> | |
22 </head> | 10 </head> |
23 </html> | 11 </html> |
OLD | NEW |