1
0
Fork 0
firefox/testing/web-platform/tests/browsing-topics/resources/fetch-topics-header-not-visible-in-service-worker-helper.tentative.https.html
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

21 lines
660 B
HTML

<!doctype html>
<body>
<script>
var current_url = window.location.href;
var fetch_url = current_url.substring(0, current_url.lastIndexOf("/")) + '/empty.html'
navigator.serviceWorker.addEventListener('message', e => {
if (e.data.fetchUrl == fetch_url) {
if (e.data.topicsHeader === 'null') {
window.opener.postMessage(
{testResult: 'Service worker intercepted no topics header'}, '*');
} else {
window.opener.postMessage(
{testResult: 'Service worker intercepted topics header'}, '*');
}
}
});
fetch(fetch_url, {browsingTopics: true});
</script>
</body>