Skip to content

Commit

Permalink
This is to correct the error with IOS not loading images
Browse files Browse the repository at this point in the history
  • Loading branch information
uramacharles committed Dec 5, 2023
1 parent dbd99f0 commit de875e4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/embed-webfonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async function embedFonts(data: Metadata, options: Options): Promise<string> {

return fetchAsDataURL<[string, string]>(
url,
options.fetchRequestInit,
options.fetchFontRequestInit,
({ result }) => {
cssText = cssText.replace(loc, `url(${result})`)
return [loc, result]
Expand Down
6 changes: 6 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,10 @@ export interface Options {
*
*/
fetchRequestInit?: RequestInit
/**
*
*the second parameter of window.fetch (Promise<Response> fetch(input[, init]))
* This would be used for fonts, thereby making it different from the Image urls of the parent project.
*/
fetchFontRequestInit?: RequestInit
}

0 comments on commit de875e4

Please sign in to comment.