JavaScript
0
Вклад в тег
function observeAndClickElement() {
const targetSelector = '.f5-notifier-notification-action_btn';
const observer = new MutationObserver((mutationsList) => {
for (let mutation of mutationsList) {
if (mutation.type === 'childList') {
const notificationButton = document.querySelector(targetSelector);
if (notificationButton) {
notificationButton.click();
console.log("Кнопка в уведомлении была нажата");
}
}
}
);
observer.observe(document.body, childList: true, subtree: true );
observeAndClickElement();