jjlharrison / JSONAce

Formats & syntax highlights JSON viewed inside of the web browser using the ACE editor!
MIT License
5 stars 1 forks source link

Rendering: Content-Type:application/hal+json;charset=UTF-8 #1

Open jeeftor opened 6 years ago

jeeftor commented 6 years ago

I've been building a hal+json service (which serves up JSON) but codes it as: 'Content-Type:application/hal+json;charset=UTF-8'

In this case Safari just downloads the file which looks something like this:

{
  "content": {
    "serviceID": "CMUToCDTI",
    "peerID": "FlightSim_0977",
    "peerName": "FlightSim",
    "translator": "SDDFTranslator:AdvTranslator",
    "transporter": "SDDFTransporter:CMSVTransporter#trumpet.mitre.org@35707",
    "contentIterator": [
      {
        "comment": "Reference FIX",
        "units": "Fix Name to Merge at",
        "type": "STRING",
        "key": "refFix"
      },
      {
        "comment": "Reference AC",
        "units": "ACID",
        "type": "STRING",
        "key": "refAcid"
      },
      {
        "comment": "acid of ownship sending this",
        "units": "ACID",
        "type": "STRING",
        "key": "acid"
      },
      {
        "comment": "TIME IN SECONDS",
        "units": "TIME",
        "type": "STRING",
        "key": "refTime"
      },
      {
        "comment": "Reference FIX",
        "units": "DUH",
        "type": "STRING",
        "key": "terminateFix"
      },
      {
        "comment": "DISTANCE NM",
        "units": "DISTANCE",
        "type": "STRING",
        "key": "refDistance"
      }
    ]
  },
  "_links": {
    "peer_id": {
      "href": "http://localhost:8090/test/peer_id/FlightSim_0977"
    },
    "peer_name": {
      "href": "http://localhost:8090/test/peer_name/FlightSim"
    },
    "service_name": {
      "href": "http://localhost:8090/test/service/CMUToCDTI"
    }
  }
}

Is it possible for this extension to recognize the additional content type application/hal+json

(works fine in chrome)

jjlharrison commented 6 years ago

Hi @jeeftor, I have been suffering with the same problem. Unfortunately, I can't find a way of making Safari support additional content types. There seems to be no reference to in the the Safari Extensions Development Guide.

If anyone can help with this, it would be greatly appreciated.