mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-02-08 21:48:12 -05:00
Show menu title based on actual profile used on mobile.
This commit is contained in:
parent
6f0f3e4636
commit
0ec584c93d
@ -135,12 +135,19 @@ actionForUrl = (url) ->
|
|||||||
profileColor = current.color
|
profileColor = current.color
|
||||||
|
|
||||||
icon ?= drawIcon(resultColor, profileColor)
|
icon ?= drawIcon(resultColor, profileColor)
|
||||||
|
|
||||||
|
shortTitle = 'Omega: ' + currentName # TODO: I18n.
|
||||||
|
if profile.name != currentName
|
||||||
|
shortTitle += ' => ' + profile.name # TODO: I18n.
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: chrome.i18n.getMessage('browserAction_titleWithResult', [
|
title: chrome.i18n.getMessage('browserAction_titleWithResult', [
|
||||||
currentName
|
currentName
|
||||||
dispName(profile.name)
|
dispName(profile.name)
|
||||||
details
|
details
|
||||||
])
|
])
|
||||||
|
|
||||||
|
shortTitle: shortTitle
|
||||||
icon: icon
|
icon: icon
|
||||||
resultColor: resultColor
|
resultColor: resultColor
|
||||||
profileColor: profileColor
|
profileColor: profileColor
|
||||||
|
@ -430,6 +430,9 @@ class ChromeOptions extends OmegaTarget.Options
|
|||||||
errorCount = @_requestMonitor?.tabInfo[tabId]?.errorCount
|
errorCount = @_requestMonitor?.tabInfo[tabId]?.errorCount
|
||||||
result = if errorCount then {errorCount: errorCount} else null
|
result = if errorCount then {errorCount: errorCount} else null
|
||||||
getBadge = new Promise (resolve, reject) ->
|
getBadge = new Promise (resolve, reject) ->
|
||||||
|
if not chrome.browserAction.getBadgeText?
|
||||||
|
resolve('')
|
||||||
|
return
|
||||||
chrome.browserAction.getBadgeText {tabId: tabId}, (result) ->
|
chrome.browserAction.getBadgeText {tabId: tabId}, (result) ->
|
||||||
resolve(result)
|
resolve(result)
|
||||||
|
|
||||||
|
@ -45,10 +45,6 @@ class ChromeTabs
|
|||||||
try chrome.browserAction.setBadgeText?(text: '', tabId: id)
|
try chrome.browserAction.setBadgeText?(text: '', tabId: id)
|
||||||
@_badgeTab = null
|
@_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 not tab.url? or tab.url.indexOf("chrome") == 0
|
||||||
if @_defaultAction
|
if @_defaultAction
|
||||||
chrome.browserAction.setTitle({
|
chrome.browserAction.setTitle({
|
||||||
@ -59,7 +55,10 @@ class ChromeTabs
|
|||||||
return
|
return
|
||||||
@actionForUrl(tab.url).then (action) =>
|
@actionForUrl(tab.url).then (action) =>
|
||||||
@setIcon(action.icon, tab.id)
|
@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) ->
|
setTabBadge: (tab, badge) ->
|
||||||
@_badgeTab ?= {}
|
@_badgeTab ?= {}
|
||||||
|
Loading…
Reference in New Issue
Block a user