diff --git a/omega-target-chromium-extension/src/coffee/background.coffee b/omega-target-chromium-extension/src/coffee/background.coffee index feb7b40..5f95757 100644 --- a/omega-target-chromium-extension/src/coffee/background.coffee +++ b/omega-target-chromium-extension/src/coffee/background.coffee @@ -135,12 +135,19 @@ actionForUrl = (url) -> profileColor = current.color icon ?= drawIcon(resultColor, profileColor) + + shortTitle = 'Omega: ' + currentName # TODO: I18n. + if profile.name != currentName + shortTitle += ' => ' + profile.name # TODO: I18n. + return { title: chrome.i18n.getMessage('browserAction_titleWithResult', [ currentName dispName(profile.name) details ]) + + shortTitle: shortTitle icon: icon resultColor: resultColor profileColor: profileColor diff --git a/omega-target-chromium-extension/src/module/options.coffee b/omega-target-chromium-extension/src/module/options.coffee index d08cd71..e9103fc 100644 --- a/omega-target-chromium-extension/src/module/options.coffee +++ b/omega-target-chromium-extension/src/module/options.coffee @@ -430,6 +430,9 @@ class ChromeOptions extends OmegaTarget.Options errorCount = @_requestMonitor?.tabInfo[tabId]?.errorCount result = if errorCount then {errorCount: errorCount} else null getBadge = new Promise (resolve, reject) -> + if not chrome.browserAction.getBadgeText? + resolve('') + return chrome.browserAction.getBadgeText {tabId: tabId}, (result) -> resolve(result) diff --git a/omega-target-chromium-extension/src/module/tabs.coffee b/omega-target-chromium-extension/src/module/tabs.coffee index 5a1cd00..3cca350 100644 --- a/omega-target-chromium-extension/src/module/tabs.coffee +++ b/omega-target-chromium-extension/src/module/tabs.coffee @@ -45,10 +45,6 @@ class ChromeTabs try chrome.browserAction.setBadgeText?(text: '', tabId: id) @_badgeTab = null - if not chrome.browserAction.setPopup? - # TODO: Is there a way to show current proxy for page? Is there even - # enough space? - return if not tab.url? or tab.url.indexOf("chrome") == 0 if @_defaultAction chrome.browserAction.setTitle({ @@ -59,7 +55,10 @@ class ChromeTabs return @actionForUrl(tab.url).then (action) => @setIcon(action.icon, tab.id) - chrome.browserAction.setTitle(title: action.title, tabId: tab.id) + if chrome.browserAction.setPopup? + chrome.browserAction.setTitle({title: action.title, tabId: tab.id}) + else + chrome.browserAction.setTitle({title: action.shortTitle, tabId: tab.id}) setTabBadge: (tab, badge) -> @_badgeTab ?= {}