Skip to content

Port of JSONView Chrome extension (which is a port of the Firefox extension) to a UserJS script

Notifications You must be signed in to change notification settings

fearphage/jsonview-opera

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

JSONView for Opera

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:

prettified JSON

Required Setup

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:

  1. Preferences (ctrl+f12)
  2. Advanced tab
  3. Select downloads
  4. Click the Add button
  5. Type application/json into the Mimetype field
  6. Type json into the Extension field
  7. Select the Open with Opera option
  8. Click Ok for both dialogs

Illustrated with pictures:

Figure 1 Figure 2

Ghetto JSON type detection

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.

Requirements

  • Page is in BackCompat mode
  • The page has a body element
  • Body contains only 1 element
  • The only element in the body is a pre tag
  • The first character of the body is a { or [

Authors

MIT Licensed

About

Port of JSONView Chrome extension (which is a port of the Firefox extension) to a UserJS script

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published