DOM breakpoints (Attributes Modifications) do not fire if the DOM element is indirectly referenced. A bug or limitation?

1,212 views
Skip to first unread message

Tony Henrich

unread,
Nov 7, 2014, 8:02:58 PM11/7/14
to google-chrome-...@googlegroups.com
Say I have a div with an id="customer". In Javascript I define a function. Inside the function I have an object with a property whose value equals the div's id value. Something like this minimalist example (using jQuery)

SomeNameSpace.myFunction = function(){


var myCustomer = {
        myDiv
: '#customer',
       
.....};


 $
(myCustomer.myDiv).hide();  <== doesn't cause the breakpoint to fire
 $('
#customer').hide();       <== this causes breakpoint to fire
 
}

If I have a DOM breakpoint (Attributes Modifications) set on the div, the hide() doesn't fire. It fires if I do: $('#customer').hide();

Is this a bug? I am trying to use these breakpoints to find what javascript is modifying some css attributes and this issue is a problem. I am using the latest Chrome and Chrome Canary.

I appreciate other ways to find these Javascripts.

PhistucK

unread,
Nov 8, 2014, 2:42:37 AM11/8/14
to Google Chrome Developer Tools
I went to the jQuery API page (since I know it has jQuery), selected the <div id="logo-events"> and set a breakpoint on attribute modifications.
Then I ran this in the console -
function p(){
var myCustomer = {
        myDiv: '#logo-events',
        };

 console.log("break! 1");
 $(myCustomer.myDiv).hide();  //<== doesn't cause the breakpoint to fire
 console.log("broke? 1");
 console.log("break! 2");
 $('#logo-events').hide();      // <== this causes breakpoint to fire
 console.log("broke? 2")
}
p();

And it broke on both of them. No problem here.


PhistucK

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-develo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/2bf18a07-6a63-4f19-8d27-4ded1cc71f2c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

PhistucK

unread,
Nov 8, 2014, 2:45:04 AM11/8/14
to Google Chrome Developer Tools
This page, sorry -


PhistucK
Reply all
Reply to author
Forward
0 new messages