tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

unload-disallowed.tentative.window.js (900B)


      1 // META: title='unload' Policy : disallowed when header is ()
      2 // META: script=/common/dispatcher/dispatcher.js
      3 // META: script=/common/utils.js
      4 // META: script=/html/browsers/browsing-the-web/remote-context-helper/resources/remote-context-helper.js
      5 // META: script=./resources/unload-helper.js
      6 // META: timeout=long
      7 
      8 'use strict';
      9 
     10 // Check that unload can be disabled by policy in main frame and subframe.
     11 promise_test(async t => {
     12  const rcHelper =
     13      new RemoteContextHelper({scripts: ['./resources/unload-helper.js']});
     14  // In the same browsing context group to ensure BFCache is not used.
     15  const main = await rcHelper.addWindow(
     16      {headers: [['Permissions-Policy', 'unload=()']]},
     17  );
     18  const subframe = await main.addIframe();
     19  await assertWindowRunsUnload(subframe, 'subframe', {shouldRunUnload: false});
     20  await assertWindowRunsUnload(main, 'main', {shouldRunUnload: false});
     21 });