|
<script> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function simulateButtonPress() { |
|
console.log('Button Pressed!'); |
|
} |
|
|
|
|
|
function observeImageChanges() { |
|
|
|
const images = document.querySelectorAll('.svelte-1pijsyv'); |
|
|
|
|
|
const observer = new MutationObserver((mutationsList, observer) => { |
|
mutationsList.forEach(mutation => { |
|
if (mutation.type === 'attributes' && mutation.attributeName === 'src') { |
|
|
|
console.log('Image changed!'); |
|
simulateButtonPress(); |
|
} |
|
}); |
|
}); |
|
|
|
|
|
const config = { attributes: true }; |
|
|
|
|
|
images.forEach(image => { |
|
observer.observe(image, config); |
|
}); |
|
} |
|
|
|
|
|
|
|
|
|
window.addEventListener('load', () => { |
|
observeImageChanges(); |
|
console.log("Yo"); |
|
}); |
|
|
|
</script> |