1
    2
    3
    4
    5
    6
    7
    8
    9
   10
   11
   12
   13
   14
   15
   16
   17
   18
   19

content / test / data / service_worker / fetch_event_set_in_install_event.js [blame]

// Copyright 2020 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

this.oninstall = function(event){
    this.onfetch = function(fetchevent) {
        var headers = new Headers;
        headers.set('Content-Language', 'fi');
        headers.set('Content-Type', 'text/html; charset=UTF-8');
        var blob = new Blob(["This resource is gone. Gone, gone, gone."]);
        var response = new Response(blob, {
            status: 301,
            statusText: 'Moved Permanently',
            headers: headers
        });

        fetchevent.respondWith(response);
    };
};