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

Side by Side Diff: chrome/common/extensions/docs/examples/extensions/mappy/mappy_content_script.js

Issue 8311007: Adding `content_security_policy` to the "Mappy" sample. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebasing. Created 9 years, 2 months 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 // 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
1 // The background page is asking us to find an address on the page. 5 // The background page is asking us to find an address on the page.
2 if (window == top) { 6 if (window == top) {
3 chrome.extension.onRequest.addListener(function(req, sender, sendResponse) { 7 chrome.extension.onRequest.addListener(function(req, sender, sendResponse) {
4 sendResponse(findAddress()); 8 sendResponse(findAddress());
5 }); 9 });
6 } 10 }
7 11
8 // Search the text nodes for a US-style mailing address. 12 // Search the text nodes for a US-style mailing address.
9 // Return null if none is found. 13 // Return null if none is found.
10 var findAddress = function() { 14 var findAddress = function() {
(...skipping 28 matching lines...) Expand all
39 var trim = /\s{2,}/g; 43 var trim = /\s{2,}/g;
40 return match[0].replace(trim, " "); 44 return match[0].replace(trim, " ");
41 } else { 45 } else {
42 console.log("bad initial match: " + found.textContent); 46 console.log("bad initial match: " + found.textContent);
43 console.log("no match in: " + text); 47 console.log("no match in: " + text);
44 } 48 }
45 } 49 }
46 return null; 50 return null;
47 } 51 }
48 52
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698