15821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)/* 25821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * Copyright (c) 2010 The Chromium Authors. All rights reserved. Use of this 35821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * source code is governed by a BSD-style license that can be found in the 45821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) * LICENSE file. 55821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) */ 65821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)var regex = /sandwich/; 75821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) 85821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)// Test the text of the body element against our regular expression. 95821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)if (regex.test(document.body.innerText)) { 105821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // The regular expression produced a match, so notify the background page. 115821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) chrome.extension.sendRequest({}, function(response) {}); 125821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} else { 135821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles) // No match was found. 145821806d5e7f356e8fa4b058a389a808ea183019Torne (Richard Coles)} 15