1 /* 2 * Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this 3 * source code is governed by a BSD-style license that can be found in the 4 * LICENSE file. 5 */ 6 var regex = /sandwich/; 7 8 // Test the text of the body element against our regular expression. 9 if (regex.test(document.body.innerText)) { 10 // The regular expression produced a match, so notify the background page. 11 chrome.extension.sendRequest({}, function(response) {}); 12 } else { 13 // No match was found. 14 } 15