Socket
Socket
Sign inDemoInstall

sane-domparser-error

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    sane-domparser-error

Provides sane parser errors for DOMParser and XHR


Version published
Weekly downloads
7.3K
decreased by-5.41%
Maintainers
1
Install size
9.41 kB
Created
Weekly downloads
 

Readme

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

Last updated on 11 Sep 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc