diff options
author | Moonchild <moonchild@palemoon.org> | 2021-03-24 09:58:48 +0000 |
---|---|---|
committer | Moonchild <moonchild@palemoon.org> | 2021-03-24 09:58:48 +0000 |
commit | cf582a3d2512e5cd0bc2ae5cfe758d0bacac603f (patch) | |
tree | 3fd651687bcec7694943e38e1539f9a8acc2c172 | |
parent | e056a306028c5cdc5db6d61a939ce1f2afe74117 (diff) | |
download | basilisk-cf582a3d2512e5cd0bc2ae5cfe758d0bacac603f.tar.gz |
[search] Don't try to force x-icon image type for search engine icon.
If it's not actually an image, then throw a warning in the console and bail.
-rw-r--r-- | basilisk/components/search/service/nsSearchService.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/basilisk/components/search/service/nsSearchService.js b/basilisk/components/search/service/nsSearchService.js index 1009051..3cd2531 100644 --- a/basilisk/components/search/service/nsSearchService.js +++ b/basilisk/components/search/service/nsSearchService.js @@ -1371,8 +1371,12 @@ Engine.prototype = { } let type = chan.contentType; - if (!type.startsWith("image/")) - type = "image/x-icon"; + if (!type.startsWith("image/")) { + console.warn( + "Search service: Unable to set icon, content type is not an image", + contentType); + return; + } let dataURL = "data:" + type + ";base64," + btoa(String.fromCharCode.apply(null, aByteArray)); |