From 23d1f076f4d799cf50f1377879f8d93389003772 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 18 Oct 2017 15:53:06 -0400 Subject: [PATCH] make sure uri has `.` in it before prefixing http --- src/popup/app/components/iconComponent.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/popup/app/components/iconComponent.js b/src/popup/app/components/iconComponent.js index ef7b6d50eea..9160c3afcbf 100644 --- a/src/popup/app/components/iconComponent.js +++ b/src/popup/app/components/iconComponent.js @@ -43,13 +43,12 @@ angular ctrl.icon = 'fa-apple'; ctrl.image = null; } - else if (ctrl.imageEnabled && hostnameUri.indexOf('://') === -1 && hostnameUri.indexOf('http://') !== 0 && - hostnameUri.indexOf('https://') !== 0) { + else if (ctrl.imageEnabled && hostnameUri.indexOf('://') === -1 && hostnameUri.indexOf('.') > -1) { hostnameUri = "http://" + hostnameUri; isWebsite = true; } else if (ctrl.imageEnabled) { - isWebsite = hostnameUri.indexOf('http') === 0 && hostnameUri.indexOf('.') > 0; + isWebsite = hostnameUri.indexOf('http') === 0 && hostnameUri.indexOf('.') > -1; } if (ctrl.imageEnabled && isWebsite) {