fix(main.js):catch exp (#619)

This commit is contained in:
isAlive 2020-02-10 11:26:38 +08:00 committed by GitHub
parent 88ab9e961d
commit 8d7624fc69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -138,7 +138,10 @@
if (!sitehost) return false;
// handle relative url
const data = new URL(input, 'http://' + sitehost);
var data;
try {
data = new URL(input, 'http://' + sitehost);
} catch (e) { return false;}
// handle mailto: javascript: vbscript: and so on
if (data.origin === 'null') return false;