Formats & syntax highlights JSON viewed inside of the web browser! Yay
An Opera port of Jamie Wilkinson's Chrome port of Ben Hollis' JSONView extension for Firefox.
Opera doesn't have extensions so this is merely a UserJS script. (install instructions)
You too can enjoy JSON as it was intended:
Opera doesn't recognize JSON as plain text and attempts to download it by default. You have to configure Opera to treat JSON like a text file. You can do this with the following steps:
- Preferences (ctrl+f12)
- Advanced tab
- Select downloads
- Click the Add button
- Type
application/jsoninto the Mimetype field - Type
jsoninto the Extension field - Select the Open with Opera option
- Click Ok for both dialogs
Opera doesn't allow scripts to see the mimetype of pages. This script currently runs on every page but exits early if the requirements aren't met.
- Page is in
BackCompatmode - The page has a
bodyelement - Body contains only 1 element
- The only element in the body is a
pretag - The first character of the body is a
{or[
- Ben Hollis @bhollis (JSONView Firefox extension)
- Jamie Wilkinson @jamiew (Chrome port - extension)
- Phred Lane @fearphage (Opera port - userjs)
MIT Licensed

