1
0
Fork 0
firefox/testing/web-platform/tests/browsing-topics/resources/fetch-topics.js
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

14 lines
438 B
JavaScript

self.addEventListener('message', event => {
if (event.data.fetchUrl) {
clients.matchAll().then((clients) => {
fetch(event.data.fetchUrl, {browsingTopics: true}).then((response) => {
response.text().then((topics_header) => {
// clients[0] is the most recently focused one
clients[0].postMessage({
topicsHeader: topics_header
});
});
});
});
}
});