Discussions » Développement

Traversing the DOM

§
Posté le: 2014-04-29
Édité le: 2014-04-29

Traversing the DOM

I have a very frustrating problem - I have written a Java script that traverses the DOM and replaces some texts by some other texts. The context is that the HTML5 code is downloaded from a site after a login, after that you can click on to some other HTML5 code segments within the same login.

After installing the script in Greasemonkey it works beautifully for all clicks EXCEPT for after the first login (this is actually the click). It looks like the first DOM downloaded is not traversed by the script at all (or that the downloaded DOM is traversed but after that is replaced by the original DOM).

This is extremely annoying - any suggestions to circumvent the problem? I have done some basic debugging and it looks like that the original DOM never is traversed.

woxxomMod
§
Posté le: 2014-10-28
Édité le: 2014-10-28

(Just found your post under lots of garbage posts which are moved to their appropriate locations now)

Could be many things, for example, the site may use ajax in which case you'll need to use a MutationObserver... but anyway where's the script code? And the page url?

Poster une réponse

Connectez-vous pour poster une réponse.