Truly independent web browser
<!DOCTYPE html>
<script src="../include.js"></script>
<iframe id="frame" src="../../data/base/a-element-target-sub.html"></iframe>
<script>
asyncTest(done => {
window.onload = () => {
const initialFrameLocation = frame.contentDocument.location.href;
frame.onload = () => {
const frameLocation = frame.contentDocument.location.href;
if (frameLocation === initialFrameLocation)
return;
println(frameLocation.includes("a-element-target-sub-alt.html") ? "Parent frame navigated successfully!" : "Parent frame incorrectly navigated to " + frameLocation);
done();
};
frame.contentDocument.getElementById("frame").contentDocument.getElementById("a").click();
};
});
</script>