diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs')
-rw-r--r-- | browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs | 48 |
1 files changed, 17 insertions, 31 deletions
diff --git a/browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs b/browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs index 5fc70c31cf..2e52a248c8 100644 --- a/browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs +++ b/browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs @@ -204,44 +204,30 @@ async function insertBookmark(bookmark) { } function setFaviconForBookmark(bookmark) { - let faviconURI; - let nullPrincipal = Services.scriptSecurityManager.createNullPrincipal({}); - switch (bookmark.Favicon.protocol) { - case "data:": - // data urls must first call replaceFaviconDataFromDataURL, using a - // fake URL. Later, it's needed to call setAndFetchFaviconForPage - // with the same URL. - faviconURI = Services.io.newURI("fake-favicon-uri:" + bookmark.URL.href); - - lazy.PlacesUtils.favicons.replaceFaviconDataFromDataURL( - faviconURI, - bookmark.Favicon.href, - 0 /* max expiration length */, - nullPrincipal + case "data:": { + lazy.PlacesUtils.favicons.setFaviconForPage( + bookmark.URL.URI, + Services.io.newURI("fake-favicon-uri:" + bookmark.URL.href), + bookmark.Favicon.URI ); - break; - + return; + } case "http:": - case "https:": - faviconURI = Services.io.newURI(bookmark.Favicon.href); - break; - - default: - lazy.log.error( - `Bad URL given for favicon on bookmark "${bookmark.Title}"` + case "https:": { + lazy.PlacesUtils.favicons.setAndFetchFaviconForPage( + bookmark.URL.URI, + bookmark.Favicon.URI, + false /* forceReload */, + lazy.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, + null, + Services.scriptSecurityManager.createNullPrincipal({}) ); return; + } } - lazy.PlacesUtils.favicons.setAndFetchFaviconForPage( - Services.io.newURI(bookmark.URL.href), - faviconURI, - false /* forceReload */, - lazy.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, - null, - nullPrincipal - ); + lazy.log.error(`Bad URL given for favicon on bookmark "${bookmark.Title}"`); } // Cache of folder names to guids to be used by the getParentGuid |