fetch-topics-header-not-visible-in-service-worker-helper.tentative.https.html (660B)
1 <!doctype html> 2 <body> 3 <script> 4 var current_url = window.location.href; 5 var fetch_url = current_url.substring(0, current_url.lastIndexOf("/")) + '/empty.html' 6 7 navigator.serviceWorker.addEventListener('message', e => { 8 if (e.data.fetchUrl == fetch_url) { 9 if (e.data.topicsHeader === 'null') { 10 window.opener.postMessage( 11 {testResult: 'Service worker intercepted no topics header'}, '*'); 12 } else { 13 window.opener.postMessage( 14 {testResult: 'Service worker intercepted topics header'}, '*'); 15 } 16 } 17 }); 18 19 fetch(fetch_url, {browsingTopics: true}); 20 </script> 21 </body>