Greasy Fork is available in English.

Дискусии » Разработка

Traversing the DOM

§
Публикуван на: 29.04.2014
Редактиран на: 29.04.2014

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.

woxxomМод
§
Публикуван на: 28.10.2014
Редактиран на: 28.10.2014

(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?

Публикувайте отговор

Влезте, за да публикувате отговор.