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

xss_blade

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

xss_blade

#### Using npm: >$ npm i xss_blade --save

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

xss防御前端过滤工具:基于npm上的xss库简单封装

Using npm:

$ npm i xss_blade --save

简单使用
    import { xssFilter, getDefaultOptions } from "xss_blade";

    html = xssFilter('<script>alert("xss");</script>');

    console.log('默认参数:', getDefaultOptions());
传递第二个参数options来自定义规则,具体规则见 xss 官方文档👍
    options = {
        whiteList:{
            a:['href'],
            img:['src']
        }
    };  // 自定义规则

    options = {
        whiteList:{}
    };  // 覆盖封装函数内的whiteList配置

    html = xssFilter('<script>alert("xssFilter");</script>', options);

FAQs

Package last updated on 22 Dec 2020

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