1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
content / test / data / shared_dictionary / fetch_dictionary.js [blame]
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// For Dedicatd Worker and Service Worker.
self.addEventListener('message', (e) => {
fetch(e.data);
});
// For Shared Worker.
self.addEventListener('connect', (e) => {
const port = e.ports[0];
port.addEventListener('message', (e) => {
fetch(e.data);
});
port.start();
});