diff --git a/src/js/regexper.js b/src/js/regexper.js index 3057d81..fea7c4b 100644 --- a/src/js/regexper.js +++ b/src/js/regexper.js @@ -87,9 +87,14 @@ export default class Regexper { detectBuggyHash() { var url; - if (typeof window.URL !== 'undefined') { - url = new URL('http://regexper.com/#%25'); - this.buggyHash = (url.hash === '#%'); + if (typeof window.URL === 'function') { + try { + url = new URL('http://regexper.com/#%25'); + this.buggyHash = (url.hash === '#%'); + } + catch(e) { + this.buggyHash = false; + } } }