leizongmin / js-xss

Sanitize untrusted HTML (to prevent XSS) with a configuration specified by a Whitelist
http://jsxss.com
Other
5.2k stars 629 forks source link

使用requirejs 引用时,即使shim,仍然为undefined #146

Open ckx321 opened 6 years ago

ckx321 commented 6 years ago

requirejs设置: paths:{ "xss" : "plugin/xss/xss.min" }, shim:{ "xss":{ deps:[], exports:"xss" } }

使用时: define([ 'xss'], function(xss){ var options = { stripIgnoreTagBody:true }; var myxss = new xss.FilterXSS(options);

}); 结果报错: 提示在定义myxss时,xss 为空 undefined