I am trying to build a very basic chrome extension. Essentially, what I want it to do is to search through a page for a bunch of names and append text (later an image) to that text. I came up with this code
// Array with names
String[] name = {
"John", "Lisa", "Marge", "Barney", "Chuck", "Bobby"
};
//search for Names and add text
for (int i = 0; i < name.length; i++) {
$('*:contains(name[i])').each(function() {
if ($(this).children().length < 1)
$(this).append('Found name');
});
}
obviously, it doesnt work. I'm having difficulties debugging the extension and I'm not quite sure why it isn't working. Can anyone help?