Testing the Service Worker

Learn how to test service workers in the browser.

We need to test that the service worker is allowing us to work offline. We will do this by following these steps:

  1. 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: ...

Get hands-on with 1400+ tech skills courses.