Fix #1159. Root cause still unclear.

This commit is contained in:
FelisCatus 2017-08-19 00:40:21 -04:00
parent bc317e0fbc
commit c860de6214
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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})