Skip to content

Commit

Permalink
fix(fonts): viv-384 iss-621 prefetch preload are not to be used in if…
Browse files Browse the repository at this point in the history
…rame due to Safa… (#622)

* issue #621: prefetch preload are not to be used in iframe due to Safari issue

* adding remarks

Co-authored-by: yinon <yinon@hotmail.com>

Co-authored-by: yinon <yinon@hotmail.com>
  • Loading branch information
gullerya and yinonov committed Jan 29, 2021
1 parent 9d1191c commit 45aeb4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 0 additions & 4 deletions .storybook/preview-head.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
<link rel="preload" href="//fonts.resources.vonage.com/fonts/v1/Spezia_Web_Complete_Upright.woff2" as="font"
type="font/woff2" crossorigin>
<link rel="prefetch" href="//fonts.resources.vonage.com/fonts/v1/Spezia_Web_Monospace_Complete.woff2" as="font"
type="font/woff2" crossorigin>
<style>
body {
outline: none;
Expand Down
4 changes: 3 additions & 1 deletion common/fonts/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,6 @@ Additionally, we suggest to 'decorate' your main HTML with the following optimiz
Explanation:
* The first link, `preload`, says to browser that it MUST load our basic, used everywhere font immediatelly.
While this will still be performed asyncronously, it'll prioritize our main font resource high.
* The second link, `prefetch`, says to browser that it MAY load our secondary, monospace font sooner than later.
* The second link, `prefetch`, hints the browser to load our secondary, _monospace_ font, sooner than later.

> Attention! We've found, that `preload` and `prefetch` are **not supported** in Safari (up and include 14) if used in **`iframe`**. Although `iframe` usage is quite rare nowadays, if there is any chance that some HTML will find itself loaded via `iframe`, please do not use the above hints as of now.

0 comments on commit 45aeb4e

Please sign in to comment.