Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that disables it given conditions:
- os == "win" : https://bugzilla.mozilla.org/show_bug.cgi?id=1845961
- This test has a WPT meta file that expects 2 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/browsers/browsing-the-web/back-forward-cache/eligibility/broadcast-channel.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/utils.js"></script>
<script src="/common/dispatcher/dispatcher.js"></script>
<script src="../resources/helper.sub.js"></script>
<script>
// Check whether the page is BFCached when there are open BroadcastChannels.
runEventTest(
{funcBeforeNavigation: () => {
window.bc = new BroadcastChannel('foo');
}},
'Eligibility (BroadcastChannel)');
// Same as above, but the BroadcastChannels are closed in the pagehide event.
runEventTest(
{funcBeforeNavigation: () => {
window.bc = new BroadcastChannel('foo');
window.addEventListener('pagehide', () => window.bc.close());
}},
'Eligibility (BroadcastChannel closed in the pagehide event)');
</script>