Truly independent web browser
<!DOCTYPE html>
<script src="../include.js"></script>
<script>
// A fresh iframe has a session history of its own, so what came before this test can't change its results.
asyncTest(async done => {
const iframe = document.createElement("iframe");
iframe.srcdoc = "<!DOCTYPE html>";
await new Promise(resolve => {
iframe.onload = resolve;
document.body.appendChild(iframe);
});
const n = iframe.contentWindow.navigation;
const len = n.entries().length;
println(`entries[length - 1] is current entry: ${n.entries()[len - 1] === n.currentEntry}`);
println(`currentEntry is a ${n.currentEntry}`);
println(`transition is null: ${n.transition == null}`);
println(`canGoBack: ${n.canGoBack}`);
println(`canGoForward: ${n.canGoForward}`);
done();
});
</script>