XMLViewer Plus

XML Viewer Plus

A fast, private XML viewer for Firefox desktop and Firefox for Android.

Version 2.0.1 · Manifest V3 · Firefox 140+ and Firefox for Android 142+ · MIT License · no data collection

Add to FirefoxDownloads & sourceWhat's new in 2.0

Screenshots

Tree: colour-coded, collapsible, any language
Tree: colour-coded, collapsible, any language
Feed: reader view for RSS and Atom
Feed: reader view for RSS and Atom
Node details: XPath, attributes, copy as XML/JSON
Node details: XPath, attributes, copy as XML/JSON
Source: highlighted, virtualised, 60,000 elements
Source: highlighted, virtualised, 60,000 elements
XML Viewer Plus on desktop

Opens XML automatically

XML Viewer Plus recognises XML by its content type, so the address does not need to end in .xml. It opens:

SVG images, XHTML pages and downloads (Content-Disposition: attachment) are left alone.

Characters. The document is decoded with the encoding it declares: the byte-order mark first, then the HTTP charset, then the <?xml encoding?> declaration, then UTF-8. Documents in ISO-8859-1, Windows-1252, Shift_JIS or UTF-16 display correctly.

Views

ViewWhat you get
TreeCollapsible and colour-coded. Short text stays on one line. Large lists load 500 children at a time, with no line limit. Use the arrow keys to move through it.
SourceSyntax-highlighted, with line numbers. Choose pretty-printed or the original text. The view is virtualised, so files of several megabytes scroll smoothly. Line wrapping is optional.
FeedA reader view for RSS 1.0, RSS 2.0 and Atom: titles, dates, authors, summaries as safe plain text, enclosures, and Show in tree.
ModeExampleNotes
TextNapoliSearches element names, attribute names and values, text, comments and CDATA. In the Source view it searches lines.
Regex^SKU-0\d{5}$JavaScript regular expressions, case-insensitive.
XPath//item[category='news']/titleXPath 1.0, with the document's own prefixes (//dc:creator). Expressions such as count(//item) show their value.
CSSitem > titleAny CSS selector.

XPath and default namespaces

In XPath 1.0, a name without a prefix never matches an element that is in a default namespace. This is why //entry finds nothing in an Atom feed. XML Viewer Plus gives the default namespace the prefix d:, and tells you so when a query finds nothing:

Press Enter for the next match and Shift+Enter for the previous one. / or Ctrl+F jumps to the search box.

Tools

Firefox for Android

Version 2.0 is built for phones too. Controls are touch-sized and the search box spans the full width. Node details open as a bottom sheet. On Android, the toolbar button is in the menu under Extensions → XML Viewer Plus. Android has no context menu for add-ons.

Local files (file://)

Since Firefox 153, add-ons cannot read files on your computer until you allow it. To open local .xml files automatically:

  1. Open Add-ons and themes (about:addons) → XML Viewer Plus → Permissions.
  2. Turn on Access local files on your computer.

Without this permission you can still use Open file… on the viewer page.

Settings

Automatic detection on or off, theme, text size, line wrapping, indentation (2 spaces, 4 spaces or a tab), tree depth on opening, feeds opening in the reader view first, and pretty-printed source.

Permissions and privacy

PermissionWhy
Access your data for all websitesXML can come from any site. On ordinary web pages the add-on reads a single property and does nothing else.
webRequest (blocking, filterResponseData)Recognise XML responses by their content type and re-encode their text as UTF-8. Only top-level documents are affected. Security headers such as Content-Security-Policy are kept.
scriptingInsert the viewer only into tabs that contain XML.
storageStore the settings, and the documents you open in the viewer page (session only).
menus, activeTabContext-menu entries; the toolbar button.

Nothing is collected or sent anywhere, and the add-on writes nothing to the console. The only requests it makes are for the document being viewed and for URLs you choose.

From the reviews

Version 2.0 is a rewrite that addresses the reviews of 1.x:

Source code

Plain JavaScript, with no libraries and no build step. The repository has an end-to-end test suite that drives a real Firefox through WebDriver BiDi (61 checks). Download xml-viewer-plus-2.0-source.zip from Files → 2.0.