Coder Social home page Coder Social logo

acrogenesis / jsonview-safari Goto Github PK

View Code? Open in Web Editor NEW
293.0 20.0 35.0 714 KB

A port of the JSONView Firefox extension that formats and syntax highlights JSON viewed inside of the browser.

Home Page: jsonview.com

License: MIT License

CSS 54.02% JavaScript 45.98%

jsonview-safari's Introduction

URGENT MESSAGE

Apple changed their Safari Extensions policy and now I need a Developer Account which costs $100 USD to release new bug fixes and features. Please send me some cash to gather the $100. Thanks! https://www.changetip.com/tipme/acrogenesis

jsonview-safari

Gratipay

Formats & syntax highlights JSON viewed inside of the web browser!

Install Now download-icon

View on Apple Safari Extensions Gallery

This plugin was ported from jsonview and jsonview-chrome

If you like JSONView check out JSONAce it's like JSONView but uses the ACE editor.

example

Contributing

  1. Fork it.
  2. Create a branch git checkout -b my_markup
  3. Commit your changes git commit -am "Cool new feature"
  4. Push to the branch git push origin my_markup
  5. Open a Pull Request
  6. Enjoy a refreshing Insert Favorite Beverage and wait

jsonview-safari's People

Contributors

acrogenesis avatar keyosk 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

jsonview-safari's Issues

jsonview-safari interferes with safari's interpretation of file upload responses

I've had an issue that has plagued me for some time. Any time i would get a proper JSON response to a file upload, safari would return server error in ExtJS when attempting to parse the responseText. Come to find out this plugin was doing something that caused this problem. Here is a URL to test this problem out.

http://ext4all.com/post/extjs-4-2-2-html-5-multi-file-upload.html

I'm using Mac OS X 10.11.3 w/ Version 9.0.3 (11601.4.4)

I have your 1.7 plugin installed (i even tested this out with the Ace plugin too)

Try to upload a file to that demo, and w/ the plugin installed and enabled you will get a server failure. If you use safari's inspector, you'll note that valid JSON is being returned. Disable the plugin and retry and it works. This was a very odd problem, and one that has stalked me for some time.

How to use in Mac OS 10.14 ?

Hello Guys,
Does it possible to use this extension in Mac OS 10.14? Looks like they removed possibility to install extension from other source except App Store. And also they still didn't implemented any way to search extension in App Store. Can you please provide direct link on App Store with this extension?

Thanks!

Not pretty printing JSON

The extension is no longer pretty printing the JSON. For example, when I navigating to the following location, I seeing the JSON as the normal raw text:

http://www.raywenderlich.com/downloads/videos/books.json

Request for new feature

It would be nice to have a button for switching to RAW mode or JSON mode the content of the page.
Thanks

Please, add support for Safari 13

After updating Safari to version 13, the JSONView extension was removed as incompatible.

Could you please add support for Safari 13?

Thank you!

Does not format JSON files

When loading a local json file into Safari - the extension does not appear to work.

Steps to reproduce:

  1. Create a json file on your computer
  2. Open safari and Drag & Drop the file to the address bar
  3. The file is loaded into Safari

Expected Results:
The loaded file should be formatted using JSON View extension

Actual Results:
The loaded file is shown as plain text

json iframe being inserted when there isn't json on the page

I am seeing the following being inserted on the bottom of some of my pages that have no json in them.

This might have just started with version 1.7

<iframe>
#document
<html>
<head>
     <style type="text/css"></style>
</head>
<body>
    <a id="raw" href="https://editedURL?&amp;jsonace=30#raw-json" class="btn btn-default">RAW</a>
    <meta charset="UTF-8">
    <title> editedURL </title>
     <link rel="stylesheet" type="text/css" href="safari-extension://com.acrogenesis.jsonview-56Q494QF3L/8b170976/default.css">
     <div id="json">
           <span class="num">12</span>
     </div>
</body>
</html>
</iframe>

Pages with content AND only 1 pre tag are falsely parsed

Pages that have valid content, and additionally have only one pre tag, are falsely parsed by this extension as JSON, you should modify your code to accommodate this.

On this line https://github.com/acrogenesis/jsonview-safari/blob/master/jsonview.safariextension/jsonview.js#L4

Instead of doing:

if(document.getElementsByTagName("pre")[0] && document.getElementsByTagName("pre").length == 1){

Consider doing this:

if(document.querySelectorAll("*").length === 1 && document.getElementsByTagName("pre")[0] && document.getElementsByTagName("pre").length == 1){

Doesn't escape unicode characters properly

View the following as JSON in the browser:

{
  "x": "\"/>\u003ch1\u003etext\u003c/h1\u003e"
}

This results in h1 being rendered as HTML by the browser instead of showing the <, > characters.

Response is not valid json

It works fine on viewing json format data. But when doing some service that interact with server by json, it do not work and show the warn message
Response is not valid json

Can't display large strings in a JSON object

ISSUE:

JSONView extension does not display a string with a length of 93179 characters


Description:

JSONView-Safari extension does not display a string with a length of 93179 characters, but when a I click the RAW button, the string is there. It does display the string of the first object of the response of a API I've built.


๐Ÿชฒ in action images:

JSONView-Safari Bug

JSONView-Safari RAW Button clicked

screen_shot_2015-05-31_at_01_00_43


Procedure to recreate the ๐Ÿชฒ :

  1. Make a call to an API via Safari address bar
  2. Receive a response with an JSON array full of objects
  3. The JSON array's objects must have a property value type string with a length of 93179 characters

IMPORTANT NOTES โš ๏ธ :

I have not test this very much, nor had made an in-depth research due to I'm overwhelmed from school work. But what I can tell is that, on FireFox JSONView it does display the JSON's object's string property value. Also, I made the API where I've receive the JSON objects and as far I can see, the API works perfectly, meaning that the API is NOT the problem...


From @gchriswill :squirrel: :

Thanks for taking time to review this issue and evaluating it. Keep up the good work! ๐Ÿ‘

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.