Coder Social home page Coder Social logo

gildas-lormeau / jsonvue Goto Github PK

View Code? Open in Web Editor NEW
1.6K 1.6K 615.0 468 KB

Fork of JSONView for Chromium-based browsers

Home Page: https://chrome.google.com/webstore/detail/chklaanhfefbnpoihckbnefhakgolnmc

License: Other

JavaScript 97.08% CSS 2.54% HTML 0.38%

jsonvue's People

Contributors

gildas-lormeau avatar kived avatar kkaefer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jsonvue's Issues

Chromium 29 reports errors trying to reference chrome.extension

This issue is reported same for most extensions, and one example is this:

callumlocke/json-formatter#26

Issue reported by Richard Hull, copied in here:


"On Chromium 29 / Ubuntu I see the following:

chrome.extension is not available: 'extension' is not allowed for specified context type content script, extension page, web page, etc.). [VM] binding (409):427
Binding.generate [VM] binding (409):427
(anonymous function) extension:114
(anonymous function) chrome-extension://bcjindcccaagfpapjjmafapmmgkkhgoa/js/content.js:54
(anonymous function) chrome-extension://bcjindcccaagfpapjjmafapmmgkkhgoa/js/content.js:387
Uncaught TypeError: Cannot call method 'connect' of undefined chrome-extension://bcjindcccaagfpapjjmafapmmgkkhgoa/js/content.js:54
(anonymous function) chrome-extension://bcjindcccaagfpapjjmafapmmgkkhgoa/js/content.js:54
(anonymous function) chrome-extension://bcjindcccaagfpapjjmafapmmgkkhgoa/js/content.js:387

This used to work on earlier versions of chromium, but maybe the method was deprecated, and they finally removed it. See here for context: https://code.google.com/p/chromium/issues/detail?id=289776#c1

Sorry: there are only two code lines that changed, but for some reason there's some whitespace changes too"

The sollution is this:

"Use chrome.runtime, not chrome.extension as per: https://code.google.com/p/chromium/issues/detail?id=289776#c1 "


runtime vs. extension

When I load the css editor in chrome 30.0.1599.101 on mac os x mavericks, I get Error: Invocation of form runtime.getBackgroundPage() doesn't match definition runtime.getBackgroundPage(function callback) on line 7 in csseditor.js. (it's not possible to edit the css)

If I try to run chrome.runtime.getBackgroundPage() in the console i get the same error. If i run chrome.extension.getBackgroundPage() an object is returned.

I guess this is related to pull request #31, since that is what is changed in that pr.

Can't handle large integer values

Example JSON document:

{"total":6463978,"limit":1,"offset":0,"times":{"query_time":1535,"http_time":1.546,"enrichment_time":0.007},"rows":[{"id":2272963852315277554}]}

JsonView will display wrong ID - instead of 2272963852315277554 it will be 2272963852315277600

Strings in local JSON not decoded correctly

Per the JSON spec, a JSON file is in one of UTF-8, UTF-16LE, UTF-16BE, UTF-32LE or UTF-32BE and the question of which is determined by examining the pattern of 00 bytes at the start of the document.

My JSON files are in UTF-8 and contain strings such as:

"• Upper"

the bullet is encoded as the 3-byte sequence 0xe2, 0x80, 0xa2. This is rendered as "• Upper" in JSONView for Chrome when the file is loaded from my local machine.

Also affected are the currency symbols in prices:

"£6.00"

the pound symbol is encoded as the 2-byte sequence 0xc2, 0xa3 is rendered as "£6.00".

We could re-write our JSON generator to encode everything outside the 7-bit clean area as a \u escape sequence but we'd really rather not.

Method to copy path

There is useful feature in your extension where hovering over a key or value shows the path. The path only shows in chrome message status in lower corner so there is no way to copy out that path. Please add method to copy path.

Bug: Nested objects in JSON get improperly HTML symbols parsed

It took me an hour to figure out this is not a bug in my backend, but in the Jsonviewer. This is the minimal example I could find. This json:
{"data":"http://panman.nl?a=b&currencyCode=EUR"}

This shows a link to "http://panman.nl?a=b¤cyCode=EUR" . Notice the strange symbol after a=b.
The &curren gets treated as a HTML symbol, while it doesn't have the (needed) semicolon:
¤ is a html symbol, &curren without the semicolon is nothing. Regardles if the JSON viewer should show HTML encoded symbols.

Support for Request Payload

The Request Payload in the Headers screen of the debugger displays JSON without any formatting.

It would be great if JSONView also had the option of formatted this.

Do not expand arrays if it would fit on the screen.

Arrays, if they only contain values, and fit in a single line should not be broken up.

This:

{
202: {
0: "12",
1: "0",
4: "0",
10: "0",
13: "0",
21: "110",
25: "200",
26: "0",
35: [
0,
0,
0,
0,
0,
0,
0,
0,
1,
0,
1,
1,
0,
0,
0,
0
],
37: [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
],
68: "237",
82: "40"
},
204: {
1: "28",
10: [
0,
0,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0
]
},
255: { },
timestamp: "Fri Feb 13 10:15:11 2015"
}

Should instead be this:

{
202: {
0: "12",
1: "0",
4: "0",
10: "0",
13: "0",
21: "110",
25: "200",
26: "0",
35: [0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0],
37: [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
68: "237",
82: "40"
},
204: {
1: "28",
10: [0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0]
},
255: { },
timestamp: "Fri Feb 13 10:15:11 2015"
}

Also when an element is collapsed, i'd expect to see at least the first 50-80 characters before ...

JSONView not capturing json return

Hi,
I'm trying out your extension, but it's not capturing the JSON return, and formatting it. It's probably something I'm doing wrong, but I don't know what. I have a WCF service that returns in JSON format. Below is my URL for testing:

http://localhost/WUOnSiteAppServer/WUOnSiteCadastroWeb.svc/Rejeicao?skip=0&take=3

Below is the raw response result. Since the content-type is a json, shouldn't it capture it and display it?

HTTP/1.1 200 OK
Content-Length: 1641
Content-Type: application/json; charset=utf-8
Server: Microsoft-IIS/7.5
X-Powered-By: ASP.NET
Date: Thu, 07 Jul 2011 14:43:39 GMT

"[\u000d\u000a {\u000d\u000a "CodMotivoRejeicao": 10,\u000d\u000a "TipoDocumento": "CPF",\u000d\u000a "CodigoDocumento": "83153672857",\u000d\u000a "NomeCliente": "Rubens Barrichello",\u000d\u000a "ValorTerminal": "ABCD",\u000d\u000a "DescricaoTipoRejeicao": "Limite de transações por período",\u000d\u000a "DataRejeicao": "\/Date(1309992011000-0300)\/",\u000d\u000a "DescricaoMotivoRejeicao": "Esta transação ultrapassa o limite de 1 transação no período de 1 dia"\u000d\u000a },\u000d\u000a {\u000d\u000a "CodMotivoRejeicao": 9,\u000d\u000a "TipoDocumento": "CPF",\u000d\u000a "CodigoDocumento": "83153672857",\u000d\u000a "NomeCliente": "Rubens Barrichello",\u000d\u000a "ValorTerminal": "ABCD",\u000d\u000a "DescricaoTipoRejeicao": "Limite de transações por período",\u000d\u000a "DataRejeicao": "\/Date(1309991862000-0300)\/",\u000d\u000a "DescricaoMotivoRejeicao": "Esta transação ultrapassa o limite de 1 transação no período de 1 dia"\u000d\u000a },\u000d\u000a {\u000d\u000a "CodMotivoRejeicao": 8,\u000d\u000a "TipoDocumento": "CPF",\u000d\u000a "CodigoDocumento": "83153672857",\u000d\u000a "NomeCliente": "Rubens Barrichello",\u000d\u000a "ValorTerminal": "ABCD",\u000d\u000a "DescricaoTipoRejeicao": "Limite de transações por período",\u000d\u000a "DataRejeicao": "\/Date(1309991191000-0300)\/",\u000d\u000a "DescricaoMotivoRejeicao": "Limite de 1 transações do Inc 1 do período 1 foi ultrapassado"\u000d\u000a }\u000d\u000a]"

Tks so much for your time and efforts

local json file

Is there a way to view a local file using the tool? If I put a local file in the address field it is not showing it formatted...for example:
file:///C:/myjson.json

Error for Nodes of size greater than maxint

Error in event handler for (unknown): Failed to execute 'setStart' on 'Range': The offset 113276 is larger than or equal to the node's length (65536).
Stack trace: Error: Failed to execute 'setStart' on 'Range': The offset 113276 is larger than or equal to the node's length (65536).
at Error (native)
at displayError (chrome-extension://chklaanhfefbnpoihckbnefhakgolnmc/content.js:18:8)
at chrome-extension://chklaanhfefbnpoihckbnefhakgolnmc/content.js:269:40
at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
at EventImpl.dispatchToListener (extensions::event_bindings:395:22)
at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)
at Event.publicClass.(anonymous function) as dispatchToListener
at EventImpl.dispatch_ (extensions::event_bindings:378:35)
at EventImpl.dispatch (extensions::event_bindings:401:17)
at Function.target.(anonymous function) (extensions::SafeBuiltins:19:14)

Quotes in links are not escaped, so the <a> tag's href is broken

{ "link": "http://www.google.com/?q=\"quotes\"" }

produces

<div id="json">
  <div class="collapser"></div>{
  <span class="ellipsis"></span>
  <ul class="obj collapsible">
    <li>
      <div class="hoverable">
        <span class="property">link</span>: 
        <span class="type-string">"</span>
        <a href="http://www.google.com/?q=" quotes""="">
          http://www.google.com/?q="quotes"
        </a>
        <span class="type-string">"</span>
      </div>
    </li>
  </ul>}
</div>

href should be "http://www.google.com/?q=&quot;quotes&quot;".
Now it is broken up into an incomplete url and an extra quotes"" attribute.

Multiple JSON content but show single JSON

I have content like this 2 different JSON in <pre> </pre> tags
screenshot_1

But i can see just first JSON data. Can i see JSON data seperate for each JSON content?
screenshot_2

sorry about cencored text. :)

字符串转义问题

bug:当字符串类型的属性中有类似这样的字符“&#87026984”时,会被转义。

improper integer rounding

My json contains 64bit ids and jsonview is rounding them causing mass confusion. So in example below 2916334247900527532 is rounded to 2916334247900527600

JSON:
{"total":1,"limit":25,"offset":0,"query_time":17,"http_time":0.0260000228881836,"rows":[{"id":2916334247900527532,"title":"LENOVO IdeaPad S10-3t","description":"Notebook z ekranem o przek\u0105tnej 10.1","price_min":1425.99,"price_max":1722.21,"offer_count":23,"shop_count":23,"category_id":10901,"product_type_id":2331,"source":"bdk","source_id":516188,"is_with_photo":"y","photo_id":"332d22eb688516883e0512828b6aba47","offer_id":null,"url_original":null,"offer_shop_id":null,"shop_name":null,"shop_url":null,"top_category_id":10901,"top_position":14,"click_value":0.0,"title_normalized":"lenovoideapads103t"}],"enrichment_time":0.0400002002716064}

Not working for data-url's?

I am using a data-url to serve json. The data-url has type as application/json but jsonview is not displaying it.

mimetype: application/{datatype}+json

Would it be possible to suport responses that uses mimetype notation "application/{datatype}+json" aswell? A lot of REST API is using this markup.

License

Can we get a license for this project? Make sure the license is compatible with any external code you are using.

Cheers!

Automatically sorts by key

The plugin automatically sorts the information by their key vs just showing how it is output.
I would think as a developer this shouldn't be default or a way to disable it.
I spend several hours today wondering why asort() wasn't working for my array and come to find out the plugin was sorting the output vs showing the exact output.

JSON encoding must be recognized as UTF

The equivalent jsonview plugin for Mozilla is able to recognize that json format uses UTF encoding

( see http://www.rfc-editor.org/rfc/rfc7159.txt section 8.1 Encoding for complete specifications)
However the current version doesn't implement this feature. More than this, chrome doesn't allow to switch the enconding manually for json content. (# menu -> more tools -> encoding entry is disabled
json_chrome
)

Support for NaN, -Infinity, Infinity

I know it isn't valid JSON, but some tools output NaN, -Infinity, and Infinity. It would be very helpful if the parser could still pretty-print JSON with these values. Right now the parser fails with "Expecting 'STRING', 'NUMBER', 'NULL', 'TRUE', 'FALSE', '{', '['"

Sample JSON to reproduce: {"maxScore":NaN}

Copy path / value doesn't work on non-toplevel elements

If I try to "copy path" / "copy value" of a non-top level part of a JSON structure I get the value of the last successful copy operation or the text "undefined" in the clipboard.

This is on Ubuntu 15.04, Chrome 44.

Example: given the following file:
{ "toplevel": { "doesn't work": "try to copy me" } }

trying to copy the inner {"doesn't work":"try to copy me"} block won't put anything on the clipboard.

Prettifying local files

Hiya,

The Firefox version of this extension prettifies the documents regardless of location (local file system or fetched from a server). The Chrome version you maintain doesn't seem to do it, although I'm not sure whether that's a Chrome thing, or an extension thing.

It's pretty easy to check, just open any .json in both browsers at the same time. E.g. test.json:
{"test":"test","test2":"test"}

FF will display 2 separate lines with highlighting, Chrome will just reproduce the line you see.

New line characters inside strings are not respected

Strings that have new line characters do not show properly. Note that the actual JSON response below contains "\n" characters but the JSONView version of the response does not.

Actual JSON:

{
    "ReviewText": "Date: 9/20/14\nProduct Reviewed: Zoomer Dino\n\nShipping time: on time\n\nPackaging: Cardboard box and plastic wrapping.\n\n"
}

As viewed in JSONView:

{
    "ReviewText": "Date: 9/20/14 Product Reviewed: Zoomer Dino Shipping time: on time Packaging: Cardboard box and plastic wrapping."
}

Add option for sorting properties alphabetically

Could you add an option to allow for sorting the properties of each object alphabetically?

I'm trying to line up two different objects that are supposed to be the same, but its hard because the viewer is displaying the order of properties seemingly randomly.

reload page before formatting is works like another request for me

looks like your plugin works kinds like:

  1. some page loads
  2. browser understands that its JSON and reload page
  3. shows the page with JSON formatting

i have a little trouble with it when working under my project:
our api can return some data just once because have an unique hash in one of url arguments, on second call it can return something like "{message:you had already requested this page}" instead of {data:"required data blablabla"}

need collapse all

if i'm looking for one field in a tree, i don't want every field expanded by default.

Wrong display order of items with numeric key

The json

{
  "brands": {
    "C72": {
      "id": "C72",
      "name": "ZYXEL"
    },
    "F08": {
      "id": "F08",
      "name": "ZWERGENWIESE"
    },
    "215": {
      "id": "215",
      "name": "ZWEIFEL"
    },
    "MKK": {
      "id": "MKK",
      "name": "ZWECKFORM"
    }
  }
}

wrongly shows

215: {
   id: "215",
   name: "ZWEIFEL"
}

as its first item inside "brands". So the view seems to put properties that are numeric at the top and thus items are displayed in the wrong order.

Uncaught Error: Parameter 2 (message) is required.

Whenever I load a webpage I get the following error thrown:
Uncaught Error: Parameter 2 (message) is required.

It is being thrown by the function validate(args, parameterSchemas) function

it looks to be at line 36:

throw new Error("Parameter " + (i + 1) + " (" + parameterSchemas[i].name + ") is required.");

not sure if anyone else is having this issue or not.

Ziptabs on Mac Lion OSX?

Sorry if this is the wrong place to communicate this...
I can't get ZipTabs to work as all . I have installed the SingleFile Core.

this is exactly the sort of tool that I need to archive pdfs open in my tabs.

Thanks so much.
If this is the wrong place to raise issues like this.. Please point me in the right direction.

John Balwit

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.