Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sane-domparser-error

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sane-domparser-error

Provides sane parser errors for DOMParser and XHR

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
decreased by-4.22%
Maintainers
1
Weekly downloads
 
Created
Source

sane-domparser-error

NPM version

Provides sane and machine readable parser errors for DOMParser and XHR (with XMLHttpRequest.responseType = 'document').

Why?

DOMParser and XHR currently do not throw an exception if a document could not be parsed, but instead return an error document.

Instead of

<parsererror xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml">
  XML Parsing Error: prefix not bound to a namespace\n Location: file:////tmp/index.html
  Line Number 1, Column 57:
  <sourcetext>
    &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;head/&gt;&lt;body&gt;&lt;namespace:customtag&gt;&lt;!-- namespace:customtag--&gt;&lt;/namespace:customtag&gt;&lt;/body&gt;&lt;/html&gt;
    --------------------------------------------------------^
  </sourcetext>
</parsererror>

you'll receive

new Error('XML Parsing Error: prefix not bound to a namespace');

Develop

$ npm run-script watchify
$ xdg-open test/test.html

or just

$ npm test

Keywords

FAQs

Package last updated on 11 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc