navigator-plugins.html (685B)
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> 6 const params = new URLSearchParams(location.search); 7 const uid = params.get('uid'); 8 9 const bc = new PrerenderChannel('prerender-channel', uid); 10 assert_true(document.prerendering); 11 12 const plugins = new Array(); 13 for (let i = 0; i < navigator.plugins.length; ++i) { 14 const plugin = navigator.plugins[i]; 15 const types = Array.from(plugin, x => x.type); 16 plugins[i] = {pluginLength: plugin.length, pluginTypes: types}; 17 } 18 bc.postMessage(JSON.stringify(plugins)); 19 bc.close(); 20 </script>