-
Notifications
You must be signed in to change notification settings - Fork 2
/
_Host.cshtml
35 lines (32 loc) · 1.19 KB
/
_Host.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
@page "/"
@namespace aspnetcore_prerendering.Pages
@using blazor_workbox_pwa
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>blazor-prerendered-pwa</title>
<base href="/" />
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
<link href="css/site.css" rel="stylesheet" />
<link rel="manifest" href="/manifest.json">
<meta name="theme-color" content="#3367D6" />
<link rel="apple-touch-icon" href="/images/icons-192.png" />
<meta name="Description" content="Blazor PWA using Workbox and Azure" />
</head>
<body>
<app>@(await Html.RenderComponentAsync<App>(RenderMode.ServerPrerendered))</app>
<script src="_framework/blazor.webassembly.js"></script>
<script>
// Check that service workers are supported
if ('serviceWorker' in navigator) {
// Use the window load event to keep the page load performant
window.addEventListener('load', () => {
navigator.serviceWorker.register('/sw.js');
});
}
</script>
</body>
</html>