![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | test/ | 2 years ago | - | |
![]() | CHANGELOG.md | 2 years ago | 400 | 0fb859dc fixed mobile overflwo options [كارل مبارك] |
![]() | LICENSE | 2 years ago | 1.0K | 0fb859dc fixed mobile overflwo options [كارل مبارك] |
![]() | README.md | 2 years ago | 586 | 0fb859dc fixed mobile overflwo options [كارل مبارك] |
![]() | index.js | 2 years ago | 854 | 0fb859dc fixed mobile overflwo options [كارل مبارك] |
![]() | package.json | 2 years ago | 1.4K | 0fb859dc fixed mobile overflwo options [كارل مبارك] |
npm install -S @braintree/sanitize-url
var sanitizeUrl = require('@braintree/sanitize-url').sanitizeUrl;
sanitizeUrl('https://example.com'); // 'https://example.com'
sanitizeUrl('http://example.com'); // 'http://example.com'
sanitizeUrl('mailto:hello@example.com'); // 'mailto:hello@example.com'
sanitizeUrl('javascript:alert(document.domain)'); // 'about:blank'
sanitizeUrl('jAvasCrIPT:alert(document.domain)'); // 'about:blank'
sanitizeUrl(decodeURIComponent('JaVaScRiP%0at:alert(document.domain)')); // 'about:blank'