From 9a4a8ca9dfbf815eeb82fb47b946438367fb2ecc Mon Sep 17 00:00:00 2001 From: Erayd Date: Thu, 11 Apr 2019 01:46:00 +1200 Subject: [PATCH] Also check that the TLD actually exists (#84) --- src/background.js | 2 +- src/popup/popup.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/background.js b/src/background.js index b929372..2d9472c 100644 --- a/src/background.js +++ b/src/background.js @@ -67,7 +67,7 @@ function pathToDomain(path) { continue; } var t = TldJS.parse(parts[key]); - if (t.isValid && t.domain !== null) { + if (t.isValid && t.tldExists && t.domain !== null) { return t.hostname; } } diff --git a/src/popup/popup.js b/src/popup/popup.js index 5664c91..1947634 100644 --- a/src/popup/popup.js +++ b/src/popup/popup.js @@ -44,7 +44,7 @@ function pathToDomain(path) { continue; } var t = TldJS.parse(parts[key]); - if (t.isValid && t.domain !== null) { + if (t.isValid && t.tldExists && t.domain !== null) { return t.hostname; } }