diff options
First simple version of ui mocker
Diffstat (limited to 'app/scripts/popup.js')
-rw-r--r-- | app/scripts/popup.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/scripts/popup.js b/app/scripts/popup.js index 5c5cf0455..2e5b98896 100644 --- a/app/scripts/popup.js +++ b/app/scripts/popup.js @@ -54,12 +54,14 @@ function setupControllerConnection (stream, cb) { } function getCurrentDomain (cb) { + const unknown = '<unknown>' + if (!chrome.tabs) return cb(null, unknown) chrome.tabs.query({active: true, currentWindow: true}, function (results) { var activeTab = results[0] var currentUrl = activeTab && activeTab.url var currentDomain = url.parse(currentUrl).host if (!currentUrl) { - return cb(null, '<unknown>') + return cb(null, unknown) } cb(null, currentDomain) }) @@ -78,7 +80,7 @@ function setupApp (err, opts) { alert(err.stack) throw err } - + clearNotifications() var container = document.getElementById('app-content') |