675 questions
0 votes
2 answers
145 views
How do I change the innerHTML of a newly created element watched by a Mutual Observer, WITHOUT causing memory leaks and freezes?
Imagine a website that has infinite scrolling, where a link saying download, appears underneath every post. I would like to change from a word to something else of anything else. (In my case a 24x24 ...
0 votes
0 answers
60 views
Attribues in MutationRecord not being set for AddedNodes/Children
I borrowed the code below from MDN, to make it quick, and added my own "watcher". If you load the page in your browser with dev tools open you'll see that, when the new child "P" ...
1 vote
1 answer
344 views
Listen for Safari Hide Distracting Items
I need to be able to take action if a Safari user has used the new "Hide distracting items" feature to remove a modal that required user interaction. In the hope that it is, at least ...
0 votes
0 answers
41 views
Fullcalendar Mutation Observer Failing to Detect Deletion of DOM Element
I am modifying the text of the "More" links created by Fullcalendar V6. When those links are clicked, Fullcalendar re-renders its own text into the element, which is behind the popover div ...
0 votes
1 answer
14 views
Click event handler is never executed
I'm using iwideo script to add a background video to a div element. This works fine. Now I would like to implement a possibility to pause the video by clicking on the overlay element created by the ...
1 vote
1 answer
168 views
Autofilled input fields show both value and label until clicked in React Material-UI TextField
I'm using Material-UI TextField components in my React application for a login form. The issue I'm facing happens when the browser (e.g., Chrome) autofills the saved credentials into the input fields. ...
0 votes
0 answers
26 views
DOMNodeInserted event for a deeply nested element that is added after some XHR call
In an HTML doc, I want to get an event for when a deeply nested element with a certain ID is added. Even some of the ancestors of the element are added conditionally after XHR calls. Is it / how can I ...
0 votes
1 answer
211 views
Javascript IntersectionObserver on Inactive Tab?
I tried to use IntersectionObserver to check, when an element (button) is visible. But when i tab out, so the tab is inactive, he doesnt see it anymore. When i tab in, he sends the console.log found ...
0 votes
0 answers
51 views
where should I add .disconnect()?
First time using mutation observer, tried to add disconnect() but seems not working. Need some advice. Thanks. const targetEl = document.querySelector('.swiper-container'); const cbMutate = (mList) =&...
0 votes
1 answer
485 views
How to ensure a MutationObserver is registered before expected changes in an iframe occur, so it can detect them? Is that even possible?
I want to be able to observe mutations in an iframe (from the parent document), so that when a certain element loads in there, I can take further actions. I haven't been able to get a MutationObserver ...
0 votes
0 answers
55 views
click() only works after setTimeout, but can't find the dependency
On a mobile version of a webpage (really just if (window.innerWidth <= 1024){}), I have a script to run a click() method on an element (a fullscreen icon) after the user clicks on an image. It all ...
0 votes
1 answer
110 views
Calculation order of CSS manipulation
I want .container to have no height set, with the only source of height from .source__height. It will change at runtime and everything should work fine. I want to keep using aspect-ration but don't ...
0 votes
0 answers
49 views
MutationObserver does not trigger when I use the network tab to throttle speed to slow 3G
Context: I want to delay loading of non-essential scripts until a dynamically created hero image has loaded. "use strict"; import { siteNavHandler } from "./siteNavHandler.min.js";...
0 votes
1 answer
70 views
How to persist MutationObserver after window.location change?
Lets say I am observing the document using MutationObserver: let mutationObserver = new MutationObserver(mutations => { ... }); mutationObserver.observe(document, { attributes: false, ...
1 vote
1 answer
85 views
Determining the indices of removedNodes in MutationRecord
I am working with MutationObserver API and want to correctly apply incoming MutationRecord to a copy of the tree I'm storing elsewhere. What puzzles me is removedNodes collection. When my observer is ...