restriction-local-file-system-access.https.html (1030B)
1 <!DOCTYPE html> 2 <title>Same-origin prerendering cannot access local file system</title> 3 <meta name="timeout" content="long"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 <script src="/common/utils.js"></script> 7 <script src="../resources/utils.js"></script> 8 <script src="resources/utils.js"></script> 9 10 <body> 11 <script> 12 setup(() => assertSpeculationRulesIsSupported()); 13 14 promise_test(async t => { 15 const uid = token(); 16 const bc = new PrerenderChannel('prerender-channel', uid); 17 18 const gotMessage = new Promise(resolve => { 19 bc.addEventListener('message', e => { 20 resolve(e.data); 21 }, { 22 once: true 23 }); 24 }); 25 26 // Start prerendering a page that attempts to show a local file picker. 27 startPrerendering(`resources/file-picker.html?uid=${uid}`); 28 const result = await gotMessage; 29 assert_equals(result, 'SecurityError') 30 }, `prerendering pages should not be able to access the local file system ` + 31 `via the File System Access API`); 32 </script>