Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/common/extensions/docs/examples/api/pageAction/pageaction_by_url/background.html

Issue 8309001: Adding `content_security_policy` to a few sample extensions. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: License and whitespace. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698