From de875e4ca1f25752d4b50fb721448842afa5b964 Mon Sep 17 00:00:00 2001 From: Urama Charles Date: Tue, 5 Dec 2023 09:53:58 +0100 Subject: [PATCH] This is to correct the error with IOS not loading images --- src/embed-webfonts.ts | 2 +- src/types.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/embed-webfonts.ts b/src/embed-webfonts.ts index 42c73da6..4c11f9bf 100644 --- a/src/embed-webfonts.ts +++ b/src/embed-webfonts.ts @@ -37,7 +37,7 @@ async function embedFonts(data: Metadata, options: Options): Promise { return fetchAsDataURL<[string, string]>( url, - options.fetchRequestInit, + options.fetchFontRequestInit, ({ result }) => { cssText = cssText.replace(loc, `url(${result})`) return [loc, result] diff --git a/src/types.ts b/src/types.ts index b511363f..7395f69b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -91,4 +91,10 @@ export interface Options { * */ fetchRequestInit?: RequestInit + /** + * + *the second parameter of window.fetch (Promise fetch(input[, init])) + * This would be used for fonts, thereby making it different from the Image urls of the parent project. + */ + fetchFontRequestInit?: RequestInit }