@@ -27,6 +27,8 @@ export async function onAddBookmark(
27
27
28
28
let screenshot : string = '' ;
29
29
30
+ const iconIsDataUrl = $currentTab . icon_url . startsWith ( 'data:' ) ;
31
+
30
32
try {
31
33
if ( capturePageScreenshot ) {
32
34
await new Promise ( ( resolve ) => {
@@ -62,7 +64,7 @@ export async function onAddBookmark(
62
64
logger . debug ( 'onAddBookmark' , 'Bookmark body' , {
63
65
url : $currentTab . url ,
64
66
title : $currentTab . title ,
65
- icon_url : $currentTab . icon_url ,
67
+ icon_url : iconIsDataUrl ? '' : $currentTab . icon_url ,
66
68
main_image_url : $currentTab . mainImage ,
67
69
content_html : $currentTab . contentHtml ,
68
70
description : $currentTab . description ,
@@ -71,7 +73,8 @@ export async function onAddBookmark(
71
73
note : $currentTab . note ,
72
74
importance : $currentTab . importance ,
73
75
flagged : $currentTab . flagged ,
74
- screenshot
76
+ screenshot,
77
+ ...( iconIsDataUrl ? { icon : $currentTab . icon_url } : { } )
75
78
} ) ;
76
79
77
80
const response = await sendToBackground <
@@ -91,7 +94,7 @@ export async function onAddBookmark(
91
94
bookmark : {
92
95
url : $currentTab . url ,
93
96
title : $currentTab . title ,
94
- icon_url : $currentTab . icon_url ,
97
+ icon_url : iconIsDataUrl ? '' : $currentTab . icon_url ,
95
98
main_image_url : $currentTab . mainImage ,
96
99
content_html : $currentTab . contentHtml ,
97
100
description : $currentTab . description ,
@@ -100,7 +103,8 @@ export async function onAddBookmark(
100
103
note : $currentTab . note ,
101
104
importance : $currentTab . importance ,
102
105
flagged : $currentTab . flagged ,
103
- screenshot
106
+ screenshot,
107
+ ...( iconIsDataUrl ? { icon : $currentTab . icon_url } : { } )
104
108
}
105
109
}
106
110
} ) ;
0 commit comments