Coder Social home page Coder Social logo

Comments (25)

rhunter avatar rhunter commented on July 17, 2024

As noted in the Google Code issue, the pattern application/*+json would cover a lot of the use cases (notably application/vnd.*+json and application/prs.*+json).

Of course, the browsers may or may not currently support registering a handler for patterns, so this ticket is more of a placeholder until they do :-(

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

Thanks for the note, and that would be nice, but I'm unaware of any way to register content-handlers for MIME type patterns in Firefox. If anyone figures out a way, I'd appreciate a pull request.

from jsonview.

chooh avatar chooh commented on July 17, 2024

Is it possible to use JSONView with Open in Browser plugin? I think such integration will solve most of issues.

from jsonview.

BrianARice avatar BrianARice commented on July 17, 2024

text/json would definitely be appreciated

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

Why are you serving text/json? It's not the right mime type for json.

On Jul 8, 2012, at 10:08 AM, BrianARice
[email protected]
wrote:

text/json would definitely be appreciated


Reply to this email directly or view it on GitHub:
#7 (comment)

from jsonview.

BrianARice avatar BrianARice commented on July 17, 2024

because, for some bizarre reason, inside an iframe, inside IE 8(?), inside an ajax call... when I return application/json... it tries to download a file... but, it seems not to with text/json... so, at the moment... my server code says if it's firefox return application/json (so this thing works)... otherwise application/json... so it would be nicer to just have this thing work with a few non-standard and/or user defined mime types.

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

Gotcha. The way I'd like to see this feature implemented in JSONView is as a list of MIME types in a list in the JSONView options. Initially it would be populated with only "application/json", but people could add more types as they require.

from jsonview.

cwilkes avatar cwilkes commented on July 17, 2024

SOLR at least until 3.5 returns "text/plain" for a json response. It would be handy if jsonview would accept a list of urls that it should handle the display for -- I have a set list of SOLR servers that I hit all the time. Is there another way to do this? It is really annoying to see a long string of text when I'm used to jsonview's goodness.

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

@cwilkes as I said above, I'd like to just have JSONView be customizable to accept whatever crazy MIME types you want.

from jsonview.

bbailleux avatar bbailleux commented on July 17, 2024

Sometimes, some servers (probably wrongly configured) use exotics Mime Types. So it will be nice to be able to add some other Types, like text/json.
Furthermore, having a menu entry to See with JSONView will be great when the content is text/plain (because this Mime Type is sometimes JSON, often something else, so adding it in the Options is non-sense).

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

Yes, that is indeed what this feature request is about.

The second part, about forcing a page to render as JSON from a menu, is #5.

from jsonview.

konklone avatar konklone commented on July 17, 2024

Sorry to file the dupe. But I don't think you should just make JSONView configurable to support alternative mime-types. JSONView should recognize application/*+json as JSON - because that's what the mime type says it is. The burden shouldn't be on individual users to add each one they come across.

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

If you can figure out how to get Firefox to recognize wildcard mime types,
please let me know. I've never been able to do it.

-Ben

Sent from my phone

On Oct 14, 2013, at 8:41 AM, Eric Mill [email protected] wrote:

Sorry to file the dupe. But I don't think you should just make JSONView
configurable to support alternative mime-types. JSONView should recognize
application/*+json as JSON - because that's what the mime type says it is.
The burden shouldn't be on individual users to add each one they come
across.


Reply to this email directly or view it on
GitHubhttps://github.com//issues/7#issuecomment-26264738
.

from jsonview.

konklone avatar konklone commented on July 17, 2024

OK, then better idea - if you need to catch explicit mime type strings, how about extracting the list of mime types you catch to a single text file in this repo? Then, people can start contributing mime types as they find them. That way, when annoying people like me start ragging on you, you point them at the file and tell them to click the "Edit" button.

from jsonview.

dotnetCarpenter avatar dotnetCarpenter commented on July 17, 2024

I think that is a good compromise.

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

Sounds good for application/json+*, feel free to send a PR.

from jsonview.

konklone avatar konklone commented on July 17, 2024

I'm new to Firefox extensions - I cloned the repo and grepped through mentions of application/json, but there's a lot. Would it be easy enough for you to extract the core uses of application/json out to a text file with just one entry? Or to give me a clue as to where to start myself?

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

I'm actually not sure myself how to do it - Currently the thing that makes it work is some combination of this line: https://github.com/bhollis/jsonview/blob/master/src/chrome.manifest#L23 and this one https://github.com/bhollis/jsonview/blob/master/src/components/jsonview.js#L210 - I remember that this was related to some change in Firefox at some point, so I don't remember whether both or needed or if it's just one or the other. I also don't know how to programmatically add contracts if it's really coming from the chrome.manifest (which I think it is). I know there's an API now for it, but it may require completely re-doing how JSONView is initialized and registered (by changing it to a new-style bootstrapped extension).

from jsonview.

konklone avatar konklone commented on July 17, 2024

Wow, okay. Writing an old-style Firefox extension looks like not a lot of fun. It does look like this is best done as part of a larger refactor into a new-style HTML/CSS/JS based extension.

Sounds like a fun project, maybe I'll learn how to do it. Do you think JSONView could be done as a new-style extension?

They have a migration guide and an old vs new breakdown. The tabs API has an experimental contentType property that says:

Returns the MIME type that the document currently loaded in the tab is being rendered as. This may come from HTTP headers or other sources of MIME information, and might be affected by automatic type conversions performed by either the browser or extensions. This property is read-only.

from jsonview.

honzajavorek avatar honzajavorek commented on July 17, 2024

+1, this is really needed with hypermedia APIs approaching - a lot of new JSON mimetypes appear:

  • application/vnd.collection+json
  • application/vnd.hal+json
  • application/vnd.siren+json
  • application/vnd.mason+json
  • ...

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

Again, I have no argument that this would be a good feature to implement, and I would be happy to look at a pull request from somebody who did so.

from jsonview.

konklone avatar konklone commented on July 17, 2024

How straightforward would a rewrite as a new-style Firefox extension be? Could it share much code with the popular Chrome extension's code?

from jsonview.

eduard93 avatar eduard93 commented on July 17, 2024

text/json still seems to be unsupported.

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

Yes, that is by design. Please read the rest of the issue.

On Jan 22, 2015, at 9:41 AM, Eduard [email protected] wrote:

text/json still seems to be unsupported.


Reply to this email directly or view it on GitHub.

from jsonview.

bhollis avatar bhollis commented on July 17, 2024

This will be in the upcoming JSONView 1.0 release.

from jsonview.

Related Issues (20)

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.