1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-07-08 04:49:12 +02:00

Add 64px toolbar icon for 4K displays

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/2477
This commit is contained in:
Raymond Hill 2023-03-27 12:59:39 -04:00
parent 08815e9798
commit 10f9559a52
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
4 changed files with 19 additions and 8 deletions

View File

@ -6,7 +6,8 @@
"browser_action": { "browser_action": {
"default_icon": { "default_icon": {
"16": "img/icon_16.png", "16": "img/icon_16.png",
"32": "img/icon_32.png" "32": "img/icon_32.png",
"64": "img/icon_64.png"
}, },
"default_title": "uBlock Origin", "default_title": "uBlock Origin",
"default_popup": "popup-fenix.html" "default_popup": "popup-fenix.html"

View File

@ -674,8 +674,16 @@ if ( webext.browserAction instanceof Object ) {
browser.runtime.getManifest().browser_action.default_title + browser.runtime.getManifest().browser_action.default_title +
' ({badge})'; ' ({badge})';
const icons = [ const icons = [
{ path: { '16': 'img/icon_16-off.png', '32': 'img/icon_32-off.png' } }, { path: {
{ path: { '16': 'img/icon_16.png', '32': 'img/icon_32.png' } }, '16': 'img/icon_16-off.png',
'32': 'img/icon_32-off.png',
'64': 'img/icon_64-off.png',
} },
{ path: {
'16': 'img/icon_16.png',
'32': 'img/icon_32.png',
'64': 'img/icon_64.png',
} },
]; ];
(( ) => { (( ) => {
@ -702,9 +710,8 @@ if ( webext.browserAction instanceof Object ) {
const imgs = []; const imgs = [];
for ( let i = 0; i < icons.length; i++ ) { for ( let i = 0; i < icons.length; i++ ) {
const path = icons[i].path; for ( const key of Object.keys(icons[i].path) ) {
for ( const key in path ) { if ( parseInt(key, 10) >= 64 ) { continue; }
if ( path.hasOwnProperty(key) === false ) { continue; }
imgs.push({ i: i, p: key, cached: false }); imgs.push({ i: i, p: key, cached: false });
} }
} }
@ -818,6 +825,7 @@ if ( webext.browserAction instanceof Object ) {
path: { path: {
'16': `img/icon_16${flavor}.png`, '16': `img/icon_16${flavor}.png`,
'32': `img/icon_32${flavor}.png`, '32': `img/icon_32${flavor}.png`,
'64': `img/icon_64${flavor}.png`,
} }
}); });
browserAction.setBadgeText({ text }); browserAction.setBadgeText({ text });

View File

@ -7,7 +7,8 @@
"browser_style": false, "browser_style": false,
"default_icon": { "default_icon": {
"16": "img/icon_16.png", "16": "img/icon_16.png",
"32": "img/icon_32.png" "32": "img/icon_32.png",
"64": "img/icon_64.png"
}, },
"default_title": "uBlock Origin", "default_title": "uBlock Origin",
"default_popup": "popup-fenix.html" "default_popup": "popup-fenix.html"

View File

@ -6,7 +6,8 @@
"browser_action": { "browser_action": {
"default_icon": { "default_icon": {
"16": "img/icon_16.png", "16": "img/icon_16.png",
"32": "img/icon_32.png" "32": "img/icon_32.png",
"64": "img/icon_64.png"
}, },
"default_popup": "popup-fenix.html", "default_popup": "popup-fenix.html",
"default_title": "uBlock Origin" "default_title": "uBlock Origin"