I want to make an extension that highlights a certain word (for example food) on every page the person visits. I was curious as how to do开发者_开发技巧 this, with a google chrome extension.
You should be able to do this just using content scripts. In your content script JS file, this line should do the trick (assuming you also include jQuery in your JS content script includes):
$('body').html($('body').html().replace(word_of_choice, '<span class="highlighted">' + word_of_choice + '</span>'));
And define the highlighted
class in a CSS file in your content script includes.
精彩评论