Skip to content

Commit

Permalink
Addresses @faliciousreasoning feedback
Browse files Browse the repository at this point in the history
This reverts some changes where chrome://favicon is in use. Currently,
the implemention for favicons needs to be unencoded. I'm working on a
separate semgrep rule to suggest people switch over to chrome://favicon2.
When I did some testing, it wasn't clear why the favicons weren't showing up
with favicon2 URIs, so I've opted to just revert for now rather than update.
  • Loading branch information
kdenhartog committed Feb 19, 2025
1 parent 959f581 commit a6b9b60
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const WalletSettingsMenu = (props: Props) => {

const onClickRoute = (route: WalletRoutes | AccountPageTabs) => {
if (route === WalletRoutes.AddHardwareAccountModalStart && isPanel) {
chrome.tabs.create({ url: `chrome://wallet${encodeURIComponent(route)}` }, () => {
chrome.tabs.create({ url: `chrome://wallet${route}` }, () => {
if (chrome.runtime.lastError) {
console.error(
'tabs.create failed: ' + chrome.runtime.lastError.message
Expand All @@ -157,7 +157,7 @@ export const WalletSettingsMenu = (props: Props) => {
if (isPanel) {
chrome.tabs.create(
{
url: `chrome://wallet${encodeURIComponent(WalletRoutes.Backup)}`
url: `chrome://wallet${WalletRoutes.Backup}`
},
() => {
if (chrome.runtime.lastError) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export function AllowAddChangeNetworkPanel(props: Props) {
return (
<StyledWrapper>
<CenterColumn>
<FavIcon src={`chrome://favicon/size/64@1x/${encodeURIComponent(originInfo.originSpec)}`} />
<FavIcon src={`chrome://favicon/size/64@1x/${originInfo.originSpec}`} />
<URLText>
<CreateSiteOrigin
originSpec={originInfo.originSpec}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function Origin(props: Props) {
? BraveIcon
: isStorybook
? `${originInfo.originSpec}/favicon.png`
: `chrome://favicon/size/64@1x/${encodeURIComponent(originInfo.originSpec)}`
: `chrome://favicon/size/64@1x/${originInfo.originSpec}`
}
/>
<URLText>
Expand Down Expand Up @@ -103,7 +103,7 @@ export function TransactionOrigin({
? BraveIcon
: isStorybook
? `${originInfo.originSpec}/favicon.png`
: `chrome://favicon/size/64@1x/${encodeURIComponent(originInfo.originSpec)}`
: `chrome://favicon/size/64@1x/${originInfo.originSpec}`
}
/>
{!isBraveWalletOrigin && isFlagged && (
Expand Down

0 comments on commit a6b9b60

Please sign in to comment.