web-hid.https.html (796B)
1 <!DOCTYPE html> 2 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharnessreport.js"></script> 4 <script src="/speculation-rules/prerender/resources/utils.js"></script> 5 <script src="/speculation-rules/prerender/resources/deferred-promise-utils.js"></script> 6 <script> 7 8 const params = new URLSearchParams(location.search); 9 10 // The main test page (restriction-web-hid.https.html) loads the initiator page, 11 // then the initiator page will prerender itself with the `prerendering` 12 // parameter. 13 const isPrerendering = params.has('prerendering'); 14 15 if (!isPrerendering) { 16 loadInitiatorPage(); 17 } else { 18 const prerenderEventCollector = new PrerenderEventCollector(); 19 prerenderEventCollector.start( 20 navigator.hid.getDevices(), 'navigator.hid.getDevices'); 21 } 22 23 </script>