tulios / json-viewer

It is a Chrome extension for printing JSON and JSONP.
https://chrome.google.com/webstore/detail/json-viewer/gbmdgpbipfallnflgajpaliibnhdgobh
MIT License
3.34k stars 685 forks source link

Conflict with zoomWheel extension #127

Closed kenime closed 7 years ago

kenime commented 7 years ago

my JSON viewer was not working and I digged into the code. Turns on another extension "zoomWheel" creates 2 elements under document.body.childNodes, so when JSON viewer is executing getPreWithSource(), the following checking will fail and not considering the page as JSON.

var childNodes = document.body.childNodes;

  if (childNodes.length === 1) {

Would there be any impact if we loosen the checking as childNodes.length > 0 ?

benvan commented 7 years ago

@kenime - are the two elements split-text nodes? If so, see https://github.com/tulios/json-viewer/pull/133

tulios commented 7 years ago

Version 0.16.2 is out! Thanks @benvan for the PR :)