DOM Protection 🔒
Features
- 🛡️ Auto-sanitizes
innerHTML and dangerouslySetInnerHTML
- ⚡ Works with JS/TS/JSX/TSX files
- 🔄 Automatic scanning on file save
Installation
- Install via VS Code extensions tab
- Search for "DOM Protection"
- Click Install
Usage
// Before (vulnerable)
element.innerHTML = userContent;
// After (protected)
element.innerHTML = DOMPurify.sanitize(userContent);
Configuration
Add to settings.json :
"domProtection.enabled": true,
"domProtection.allowedTags": ["b", "i", "a"]
Changelog
Version |
Changes |
1.0.0 |
Initial release |
| |