Using browser context for social cards

Scott Hanselman recommended using the context instead of the browser object. Browser object creates a new context on each call which is a new process. Obviously we don't want that. 

Also added an extra check for a load based on network idle. This will not only ensure things are loaded, but there is a built in 500ms timeout looking for inactivity which will let the font rendering process do it's thing which seems to lag a tad with Chromium.

And while we are at it, preloading the font can't hurt.
This commit is contained in:
Phil Scott
2021-07-17 22:33:04 -04:00
committed by Patrik Svensson
parent 223642b797
commit c2b25eea8a
2 changed files with 14 additions and 7 deletions

View File

@ -8,6 +8,7 @@
<html>
<head>
<link rel="preload" as="font" href="/static/CascadiaCodePL.woff2">
<link rel="stylesheet" href="static/styles.css" />
</head>
<body>