mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-02-02 02:58:13 -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
|
||||
|
||||
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
|
||||
|
@ -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)
|
||||
|
||||
|
@ -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 ?= {}
|
||||
|
Loading…
Reference in New Issue
Block a user