Testing the Service Worker
Explore how to verify that the service worker allows your Blazor Progressive Web App to work offline. Learn to use browser developer tools to inspect app manifest, service worker registrations, cache storage, and test offline mode effectively.
We'll cover the following...
We'll cover the following...
We need to test that the service worker is allowing us to work offline. We will do this by following these steps:
- From the “Debug” menu, select the “Start Without Debugging (Ctrl + F5)” option to run the project.
Test yourself
Run the app below:
<Router AppAssembly="@typeof(App).Assembly">
<Found Context="routeData">
<RouteView RouteData="@routeData" DefaultLayout="@typeof(MainLayout)" />
<FocusOnNavigate RouteData="@routeData" Selector="h1" />
</Found>
<NotFound>
<PageTitle>Not found</PageTitle>
<LayoutView Layout="@typeof(MainLayout)">
<p role="alert">Sorry, there's nothing at this address.</p>
</LayoutView>
</NotFound>
</Router>
Testing WeatherForecast PWA
Note: Open the app in the browser by clicking on the ...