<!DOCTYPE html><metacharset="utf-8"><title>Clicking on an <a> element with a download attribute must not throw an exception</title><linkrel="author"title="Domenic Denicola"href="mailto:d@domenic.me"><linkrel="help"href="https://html.spec.whatwg.org/multipage/#the-a-element:activation-behaviour"><linkrel="help"href="https://github.com/whatwg/html/issues/2116"><scriptsrc="/resources/testharness.js"></script><scriptsrc="/resources/testharnessreport.js"></script><body><script>"use strict";async_test(t=>{constframe=document.createElement("iframe");frame.addEventListener("load",t.step_func(function(){frame.contentWindow.addEventListener("beforeunload",t.unreached_func("Navigated instead of downloading"));conststring="test";constblob=newBlob([string],{type:"text/html"});constlink=frame.contentDocument.querySelector("#blob-url");link.href=URL.createObjectURL(blob);link.click();t.step_timeout(()=>t.done(),1000);}));frame.src="resources/a-download-click.html";document.body.appendChild(frame);},"Clicking on an <a> element with a download attribute must not throw an exception");</script></body>