summaryrefslogtreecommitdiffstats
path: root/browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-12 05:35:29 +0000
commit59203c63bb777a3bacec32fb8830fba33540e809 (patch)
tree58298e711c0ff0575818c30485b44a2f21bf28a0 /browser/components/enterprisepolicies/helpers/BookmarksPolicies.sys.mjs
parentAdding upstream version 126.0.1. (diff)
downloadfirefox-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.mjs48
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