I am working on a Chrome extension that interacts with an iframe on a webpage. What I want to do is click on a checkbox inside the iframe, after which the UI should update as if a regular user clicked on the checkbox. However, even though the checkbox is clicked (as confirmed by the logs), the UI does not update.
This is part of my code:
var checkbox = iframedoc.getElementsByClassName("leaflet-control-layers-selector")[0];
if (checkbox) {
console.log("Checkbox found");
console.log(checkbox.checked);
if(!checkbox.checked) {
checkbox.click();
console.log("Checkbox clicked");
console.log(checkbox.checked);
}
} else {
console.log("Checkbox not found");
}