I am building a tiny Chrome extension which purpose is to hide Twitter-users I am already following from user's follower/following pages. The really simple code I wrote works perfectly with the initial DOM, but when Twitter/browser loads more users to the end of the list, I am not able to reach these added users with jQuery. So it seems that jQuery is only able to reach the original DOM, not the updated one.
So, the question is, how do I reach the updated DOM with jQuery? Currently I fetch the user elements with simple
var cells = $(".Grid-cell");
EDIT:
Here's the whole code I have in content.js:
var cells = $(".Grid-cell");
_.each(cells, function (cell) {
var theCell = $(cell);
var avatarLink = theCell.find("a.ProfileCard-avatarLink");
var title = $(avatarLink).attr("title");
if (title !== undefined) {
var userActions = theCell.find("div.user-actions");
if ($(userActions).hasClass("following") && $(userActions).hasClass("including") && $(userActions).hasClass("btn-group") && $(userActions).hasClass("not-muting")) {
if (!$(userActions).hasClass("not-following")) {
theCell.hide();
}
}
}
});
I also use underscore.js...