From 8d7624fc69dc611e47f924c84e8d189bfc4bfc3b Mon Sep 17 00:00:00 2001 From: isAlive Date: Mon, 10 Feb 2020 11:26:38 +0800 Subject: [PATCH] fix(main.js):catch exp (#619) --- source/js/main.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/js/main.js b/source/js/main.js index e387851..f560ae1 100644 --- a/source/js/main.js +++ b/source/js/main.js @@ -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;