Commit d5a203b7 authored by ariasuni's avatar ariasuni
Browse files

Add favicon for about:profiling and don’t recolor colorful favicons

about:privatebrowsing and about:logins use colorful favicons.
Don’t recolor them according to theme like other, monochrome ones
parent 03b6e276
Pipeline #341542 failed with stages
in 2 minutes and 7 seconds
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
<path fill="context-fill" fill-opacity="context-fill-opacity" d="M10.85 6.85a.5.5 0 0 0-.7-.7l-2.5 2.5.7.7 2.5-2.5zM8 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2zM5 1a1 1 0 0 1 1-1h4a1 1 0 1 1 0 2H6a1 1 0 0 1-1-1zM8 4a5 5 0 1 0 0 10A5 5 0 0 0 8 4zM1 9a7 7 0 1 1 14 0A7 7 0 0 1 1 9z"/>
</svg>
\ No newline at end of file
......@@ -218,16 +218,20 @@ export default class Sidetab {
this._iconView.classList.remove("default-favicon");
this._iconView.classList.toggle(
"chrome-icon",
// Color monochrome favicons according to theme like in Firefox native tab bar
favIconUrl.startsWith("chrome://") &&
// Color built-in monochrome favicons according to theme like in native tab bar
this.url.startsWith("about:") &&
favIconUrl.endsWith(".svg") &&
// but don’t recolor colorful icons (on about:privatebrowsing and about:logins)
favIconUrl !== "chrome://browser/skin/privatebrowsing/favicon.svg" &&
favIconUrl !== "chrome://browser/content/aboutlogins/icons/favicon.svg",
// but don’t recolor colorful icons
this.url !== "about:privatebrowsing" &&
this.url !== "about:logins",
);
// Some built-in icons can’t be loaded, so we use our own
// https://bugzilla.mozilla.org/show_bug.cgi?id=1462948
if (favIconUrl === "chrome://mozapps/skin/extensions/extensionGeneric-16.svg") {
if (this.url === "about:addons") {
favIconUrl = "img/extensions.svg";
} else if (this.url === "about:profiling") {
favIconUrl = "img/profiler-stopwatch.svg";
}
this._iconView.style.setProperty("--favicon-url", `url("${favIconUrl}")`);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment