My problem : How can the news page be manipulated to only show information about messi , non-messenger information will be hidden
My manifest.json looks like this:
{
"name": "Load-by-keyword",
"version": "1.2",
"description": "Build an Extension! Load-by-keyword",
"manifest_version": 3,
"action":
{
"default_title": "Load-by-keyword"
},
"content_scripts": [
{
"matches": ["https://vnexpress.net/the-thao"],
"css": ["css/style.css"],
"js": [
"js/libs/jquery.js",
"js/content.js"
],
"run_at": "document_end"
}
],
"permissions": ["scripting" , "activeTab"]
}
jQuery
$(document).ready(function() {
var messiRegex = /messi/ig;
$("body").each(function() {
$('article').each(function() {
if ($(this).find('h3.title-news > a').text().indexOf('Messi') === -1) {
$(this).addClass("d-none");
}
});
});
});