Add vendor creation
Signed-off-by: Bryan Frimin <bryan@getprobo.com> Signed-off-by: Sacha Al Himdani <sacha@getprobo.com>
This commit is contained in:
committed by
Sacha Al Himdani
parent
fe3128da2a
commit
c2a69b5428
@@ -7,3 +7,16 @@ export function sprintf(str: string, ...params: unknown[]): string {
|
||||
return params[i++] as string;
|
||||
});
|
||||
}
|
||||
|
||||
export function faviconUrl(url?: string | null): string | null {
|
||||
if (!url) {
|
||||
return null;
|
||||
}
|
||||
|
||||
try {
|
||||
const parsedUrl = new URL(url);
|
||||
return `https://www.google.com/s2/favicons?domain=${parsedUrl.hostname}&sz=64`;
|
||||
} catch (e) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user