From c860de6214f27bc207ed856fbff7c6bd85d24ca1 Mon Sep 17 00:00:00 2001 From: FelisCatus Date: Sat, 19 Aug 2017 00:40:21 -0400 Subject: [PATCH] Fix #1159. Root cause still unclear. --- omega-target-chromium-extension/src/coffee/background.coffee | 4 +++- omega-target-chromium-extension/src/module/tabs.coffee | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/omega-target-chromium-extension/src/coffee/background.coffee b/omega-target-chromium-extension/src/coffee/background.coffee index 5f95757..77a8e19 100644 --- a/omega-target-chromium-extension/src/coffee/background.coffee +++ b/omega-target-chromium-extension/src/coffee/background.coffee @@ -66,7 +66,7 @@ actionForUrl = (url) -> options.ready.then(-> request = OmegaPac.Conditions.requestFromUrl(url) options.matchProfile(request) - ).then ({profile, results}) -> + ).then(({profile, results}) -> current = options.currentProfile() currentName = dispName(current.name) if current.profileType == 'VirtualProfile' @@ -152,6 +152,7 @@ actionForUrl = (url) -> resultColor: resultColor profileColor: profileColor } + ).catch -> return null storage = new OmegaTargetCurrent.Storage('local') @@ -185,6 +186,7 @@ options._inspect = new OmegaTargetCurrent.Inspect (url, tab) -> state.set({inspectUrl: url}) actionForUrl(url).then (action) -> + return if not action parsedUrl = OmegaTargetCurrent.Url.parse(url) if parsedUrl.hostname == OmegaTargetCurrent.Url.parse(tab.url).hostname urlDisp = parsedUrl.path diff --git a/omega-target-chromium-extension/src/module/tabs.coffee b/omega-target-chromium-extension/src/module/tabs.coffee index 3cca350..8af02c3 100644 --- a/omega-target-chromium-extension/src/module/tabs.coffee +++ b/omega-target-chromium-extension/src/module/tabs.coffee @@ -54,6 +54,9 @@ class ChromeTabs @clearIcon tab.id return @actionForUrl(tab.url).then (action) => + if not action + @clearIcon tab.id + return @setIcon(action.icon, tab.id) if chrome.browserAction.setPopup? chrome.browserAction.setTitle({title: action.title, tabId: tab.id})