nolimit-x 1.0.17 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/placeholders.js +3 -1
- package/src/utils.js +38 -13
- package/templates/messages.html +1 -0
package/package.json
CHANGED
package/src/placeholders.js
CHANGED
|
@@ -103,7 +103,9 @@ const dynamicPlaceholders = [
|
|
|
103
103
|
}
|
|
104
104
|
// Otherwise fetch favicon for the domain as base64
|
|
105
105
|
const domain = utils.getDomainFromEmail(email);
|
|
106
|
-
|
|
106
|
+
const dataUri = await utils.fetchFaviconBase64(domain);
|
|
107
|
+
console.log('FAVICON placeholder:', { email, domain, dataUriLength: dataUri.length, dataUri: dataUri.slice(0, 60) });
|
|
108
|
+
return dataUri;
|
|
107
109
|
}
|
|
108
110
|
},
|
|
109
111
|
|
package/src/utils.js
CHANGED
|
@@ -163,6 +163,25 @@ const faviconCache = {};
|
|
|
163
163
|
const CACHE_FILE = 'favicons-cache.json';
|
|
164
164
|
const FAVICON_TIMEOUT = 3000; // 3 seconds
|
|
165
165
|
|
|
166
|
+
// Special favicon mapping for major providers
|
|
167
|
+
const specialFavicons = {
|
|
168
|
+
'gmail.com': 'https://ssl.gstatic.com/ui/v1/icons/mail/rfr/gmail.ico',
|
|
169
|
+
'googlemail.com': 'https://ssl.gstatic.com/ui/v1/icons/mail/rfr/gmail.ico',
|
|
170
|
+
'yahoo.com': 'https://s.yimg.com/rz/l/yahoo_en-US_f_p_142x37.png',
|
|
171
|
+
'outlook.com': 'https://outlook-1.cdn.office.net/assets/mail/pwa/v1/pngs/favicon-32x32.png',
|
|
172
|
+
'hotmail.com': 'https://outlook-1.cdn.office.net/assets/mail/pwa/v1/pngs/favicon-32x32.png',
|
|
173
|
+
'aol.com': 'https://www.aol.com/favicon.ico',
|
|
174
|
+
'icloud.com': 'https://www.apple.com/favicon.ico',
|
|
175
|
+
'protonmail.com': 'https://proton.me/favicon.ico',
|
|
176
|
+
'zoho.com': 'https://www.zoho.com/favicon.ico',
|
|
177
|
+
'mail.com': 'https://www.mail.com/favicon.ico',
|
|
178
|
+
'gmx.com': 'https://www.gmx.com/favicon.ico',
|
|
179
|
+
'yandex.com': 'https://mail.yandex.com/favicon.ico',
|
|
180
|
+
'fastmail.com': 'https://www.fastmail.com/favicon.ico',
|
|
181
|
+
'kolabnow.com': 'https://kolabnow.com/sites/default/files/favicon.ico',
|
|
182
|
+
// Add more as needed
|
|
183
|
+
};
|
|
184
|
+
|
|
166
185
|
// Load persistent favicon cache from disk
|
|
167
186
|
function loadFaviconCache() {
|
|
168
187
|
try {
|
|
@@ -249,20 +268,26 @@ async function fetchFavicon(domain) {
|
|
|
249
268
|
if (faviconCache[domain]) return faviconCache[domain];
|
|
250
269
|
}
|
|
251
270
|
let faviconUrl = '';
|
|
252
|
-
//
|
|
253
|
-
|
|
254
|
-
faviconUrl =
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
271
|
+
// Use special mapping if available
|
|
272
|
+
if (specialFavicons[domain]) {
|
|
273
|
+
faviconUrl = specialFavicons[domain];
|
|
274
|
+
console.log(`Using special favicon for ${domain}: ${faviconUrl}`);
|
|
275
|
+
} else {
|
|
276
|
+
// Try fallback sources directly (skip localhost fetch)
|
|
277
|
+
try {
|
|
278
|
+
faviconUrl = await fetchFaviconFallback(domain);
|
|
279
|
+
if (faviconUrl) {
|
|
280
|
+
console.log(`Fetched favicon for ${domain}: ${faviconUrl}`);
|
|
281
|
+
} else {
|
|
282
|
+
console.warn(`No favicon found for ${domain}, using default.`);
|
|
283
|
+
}
|
|
284
|
+
} catch (error) {
|
|
285
|
+
console.warn(`Fallback favicon fetch failed for ${domain}:`, error.message);
|
|
286
|
+
}
|
|
287
|
+
// Use a default favicon if all else fails
|
|
288
|
+
if (!faviconUrl) {
|
|
289
|
+
faviconUrl = 'https://www.google.com/s2/favicons?sz=32&domain_url=' + encodeURIComponent(domain);
|
|
259
290
|
}
|
|
260
|
-
} catch (error) {
|
|
261
|
-
console.warn(`Fallback favicon fetch failed for ${domain}:`, error.message);
|
|
262
|
-
}
|
|
263
|
-
// Use a default favicon if all else fails
|
|
264
|
-
if (!faviconUrl) {
|
|
265
|
-
faviconUrl = 'https://www.google.com/s2/favicons?sz=32&domain_url=' + encodeURIComponent(domain);
|
|
266
291
|
}
|
|
267
292
|
// Cache the result
|
|
268
293
|
faviconCache[domain] = faviconUrl;
|