I try to select an specific element at a transfermarketlist... Therefore i edited a specific class with specific values and deleted the current class "selected" from the first transfermarketlistobject. I added the selected class then to the specific element but its not wokring to ".click" the element. Need to simulate a real click to the object to get it work and show the object at the website
var observeTransferList = new MutationObserver(function (mutations) {
mutations.forEach(function (mutation) {
mutation.addedNodes.forEach(function (node) {
if (node.nodeType === 1 && node.matches(".has-auction-data")) {
$(node).css("height", "37");
$(node).removeClass('selected');
chrome.storage.sync.get(function (items) {
platform = items.platform;
percentage = items.percentage;
var playerData = getPlayerData(node, platform, percentage);
$(node).append(playerData);
if (playerData.colorPicked) {
$(node).css("backgroundColor", playerData.colorPicked); //can be "" by default, or green, yellow etc
//$(node).css("height", "37");
var price = Math.trunc(
parseInt(playerData.binValue.replace(/,/g, "")) / 0.949
);
}
// -------- CODE HERE -----------//
if (node.matches('[style*="background-color"]')) { //works
$(node).css("height", "60"); //works
$(node).addClass('selected')//works
//$(node).click('selected'); // not working
//$(node).click(); // not working either
}
the transferobjectlist look like this:
If any questions just ask please :)