square / PonyDebugger

Remote network and data debugging for your native iOS app using Chrome Developer Tools
Other
5.87k stars 595 forks source link

Javascript issues with the Coredata browser #140

Open GabrielCartier opened 9 years ago

GabrielCartier commented 9 years ago

Not sure when this started exactly but I can't seem to be browsing my coredata entity as I'm getting javascript error. I didn't debug so much but I got to see that whenever I press and entity in the IndexedDB tree, I get these javascript errors:

Uncaught TypeError: undefined is not a function treeoutline.js:1120
TreeElement.isEventWithinDisclosureTriangle treeoutline.js:1120
TreeElement.treeElementMouseDown treeoutline.js:806
Uncaught TypeError: undefined is not a function treeoutline.js:1120 
TreeElement.isEventWithinDisclosureTriangle treeoutline.js:1120 
TreeElement.treeElementToggled treeoutline.js:819 

This actually prevents me from accessing any entities from Chrome. From Safari, I can get a bit further but I still can't access the entities. I didn't get the javascript error.

I inspected the javascript a bit and found out that treeoutline.js has a comment saying: // FIXME: We should not use getComputedStyle(). For that we need to get rid of using ::before for disclosure triangle. (http://webk.it/74446)

Let me know if you need any more info or stack trace.

bsidoti commented 9 years ago

I'm getting the same thing

mark-anders commented 9 years ago

Hi, I was just getting the same thing and had a giggle when the Chrome debugger stopped at the line below the fixme. :-) I have still not gotten Chrome working, but I did get Safari working. Note - I had not tried Safari prior to doing what I'm going to describe, so try that first. However, here's the complete set of things I did:

  1. First, I upgraded my Podfile to pull in 0.4.3 as I was still using 0.4.0.
  2. I then did an upgrade of my server by doing the following: (from PonyDebugger/README):
  # activate your virtualenv
  source ~/Library/PonyDebugger/bin/activate
  # update the ponyd source
  pip install -U -e git+https://github.com/square/PonyDebugger.git#egg=ponydebugger
  # updates chrome dev tools source
  ponyd update-devtools     

Note that upgrading the source via pip failed due to the pybonjour not being found. However the last line updating the dev tools worked.

After that, I tried it in Chrome, saw it didn't work, and found a note in the "Known Issues" that mentioned Chrome having a problem and recommending Safari.

gfpacheco commented 8 years ago

Open ~/Library/PonyDebugger/src/devtools/treeoutline.js and change the following lines:

// lines 1120 and 1121
var paddingLeftValue = window.getComputedStyle(this._listItemNode).getPropertyCSSValue("padding-left");
var computedLeftPadding = paddingLeftValue ? paddingLeftValue.getFloatValue(CSSPrimitiveValue.CSS_PX) : 0;

For these:

var paddingLeftValue = window.getComputedStyle(this._listItemNode).paddingLeft;
var computedLeftPadding = parseFloat(paddingLeftValue, 10);

Re-run ponyd