Fix favicon PR #1118: guarded computed + browser.ts constants#1554
Open
indigokarasu wants to merge 1 commit into
Open
Fix favicon PR #1118: guarded computed + browser.ts constants#1554indigokarasu wants to merge 1 commit into
indigokarasu wants to merge 1 commit into
Conversation
…lict) The original favicon PR (Authenticator-Extension#1118) targeted an MV2 base and had been open ~2 years; dev is now MV3 and the branch no longer merges. This re-implements the feature against current dev conventions and fixes the original bugs: - Built for MV3: uses the favicon permission + the chrome.runtime.getURL ('/_favicon/') endpoint instead of the dead MV2 chrome://favicon/ URL. Only the 'favicon' optional permission is requested (on toggle); the invalid MV2 'chrome://favicon/' host permission and CSP scheme are dropped. The extension's own _favicon resource is already covered by img-src 'self', so no CSP relaxation is needed. - EntryComponent.shouldShowFavicon is a proper reactive computed returning !isFirefox && !isSafari && menu.showFavicon (uses browser.ts constants), fixing the original && short-circuit bug that discarded the guard. - Wires showFavicon into the new UserSettings model (interface, BooleanOption, isBooleanOption) and the menu store, so the setting persists and syncs. - Favicons are fetched lazily per entry at render time; nothing bundled or pre-downloaded. medal.svg is a UI placeholder glyph, not a site favicon. Maintainer constraints honored: no mandatory permissions added, no pre-installed or pre-downloaded favicons.
27f3abf to
6de9959
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a corrected version of the favicon feature from #1118 (based on the
faviconbranch). It addresses the open review feedback and keeps the maintainer's stated constraints intact.What was broken
EntryComponent.vue—shouldShowFaviconThe original expression was:
Because of
&&short-circuit evaluation, the boolean guard was discarded and the value resolved to the rawmapStategetter function (always truthy). The Firefox/Safari guard was effectively lost and the property was not a proper reactive computed. Replaced with a real computed that returns!isFirefox && !isSafari && this.$store.state.menu.showFavicon, using the constants already exported frombrowser.ts.PreferencesPage.vue— favicon toggleThe toggle used a raw
navigator.userAgent.indexOf("Firefox")check stored asisNotFirefoxindata(), which shadowed/collided with the existingisSupportedcomputed. Switched the toggle to thebrowser.ts-basedisSupported(Firefox and Safari) and removed the conflicting data field.Maintainer constraints preserved
faviconandchrome://favicon/remain inoptional_permissions(requested only when the user enables the setting), not mandatorypermissions.chrome://favicon/<TLD>); nothing is bundled in the package or pre-downloaded for sites the user does not have.medal.svgis a UI placeholder glyph shown when no::domainis set, not a pre-installed site favicon.Reviewer suggestions already applied in the branch (label "Show Website Icon", MV3 TODO comment) are kept as-is.
Fixes the code-review items from #1118.