mirror of https://github.com/gorhill/uBlock.git
Insert icon badge text in icon title only if needed
This is to fix the rendering of the menu entry in Firefox Fenix, which displays both the icon title and badge text as a menu entry: Before the fix: uBlock Origin (76) 76 After the fix: uBlock Origin 76 The badge text will still be part of the icon title when the icon badge is disabled by the user or when the platform does not supprt browserAction.setIcon() (as is the case on current Firefox for Android).
This commit is contained in:
parent
c49b58bf54
commit
9637ab56a9
|
@ -824,7 +824,14 @@ vAPI.setIcon = (( ) => {
|
|||
}
|
||||
}
|
||||
|
||||
if ( browserAction.setTitle !== undefined ) {
|
||||
// Insert the badge text in the title if:
|
||||
// - the platform does not support browserAction.setIcon(); OR
|
||||
// - the rendering of the badge is disabled
|
||||
if (
|
||||
browserAction.setTitle !== undefined && (
|
||||
browserAction.setIcon === undefined || (parts & 0b1000) !== 0
|
||||
)
|
||||
) {
|
||||
browserAction.setTitle({
|
||||
tabId: tab.id,
|
||||
title: titleTemplate.replace(
|
||||
|
|
Loading…
Reference in New Issue