Esta discussão foi arquivada. Se precisar de ajuda, por favor, coloque uma nova questão.
Is there a function like that? Can I create one easily? If not, would it be worthy of the Firefox team?
Todas as respostas (7)
Try to ask advice at the Stack Overflow forum site.
Unfortunately, that information -- "how exactly did this element get added to the DOM" -- is not part of the DOM itself, so I can't think of any place to access it.
It would be interesting to try to create such a feature. If I were to inject a Mutation Observer into the document to take some action every time an element were added to the DOM, I don't know how my script could determine what line in what script just did that. Looking at it from the other perspective, could the debugger be persuaded to log the relevant details each time it added an element to the DOM? This probably exists in some debugger somewhere and probably could be brought to Firefox, but... not by me.
How about an approach where the element(s) are identified in advance? In other words, I want to know the instance source of foobar so when the various sources are processed just id/name=foobar have supplemented code generated. At execution time the extra code reports on the origin source, perhaps in a user designated variable.
It's not uncommon to set a watch in a debugger, but the details are beyond my expertise.
The debugger would not meet my application needs since the program would be in production.
I suppose I'm just going to need to give up on this feature request for now.
I'll find a different way.
I'm not sure you should give up just yet... This support forum is not a place to get features added to Firefox; at most we can describe what's available now, what we know to be coming, the add-ons we know about, and ideas we might have. You could take your request to either or both of the following:
- Dev Tools Forum: https://discourse.mozilla-community.org/c/devtools
- Mailing List: https://lists.mozilla.org/listinfo/dev-developer-tools