1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/browser/base/content/test/general/download_page.html Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,47 @@ 1.4 +<!DOCTYPE HTML> 1.5 +<html> 1.6 +<!-- 1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=676619 1.8 +--> 1.9 + <head> 1.10 + <title>Test for the download attribute</title> 1.11 + 1.12 + </head> 1.13 + <body> 1.14 + <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=676619">Bug 676619</a> 1.15 + <br/> 1.16 + <ul> 1.17 + <li><a href="data:text/plain,Hey What are you looking for?" 1.18 + download="test.txt" id="link1">Download "test.txt"</a></li> 1.19 + <li><a href="video.ogg" 1.20 + download id="link2">Download "video.ogg"</a></li> 1.21 + <li><a href="video.ogg" 1.22 + download="just some video" id="link3">Download "just some video"</a></li> 1.23 + <li><a href="data:text/plain,test" 1.24 + download="with-target.txt" id="link4">Download "with-target.txt"</a></li> 1.25 + <li><a href="javascript:1+2" 1.26 + download="javascript.txt" id="link5">Download "javascript.txt"</a></li> 1.27 + </ul> 1.28 + <script> 1.29 + var li = document.createElement('li'); 1.30 + var a = document.createElement('a'); 1.31 + 1.32 + a.href = window.URL.createObjectURL(new Blob(["just text"])) ; 1.33 + a.download = "test.blob"; 1.34 + a.id = "link6"; 1.35 + a.textContent = 'Download "test.blob"'; 1.36 + 1.37 + li.appendChild(a); 1.38 + document.getElementsByTagName('ul')[0].appendChild(li); 1.39 + 1.40 + window.addEventListener("beforeunload", function (evt) { 1.41 + document.getElementById("unload-flag").textContent = "Fail"; 1.42 + }); 1.43 + </script> 1.44 + <ul> 1.45 + <li><a href="http://example.com/" 1.46 + download="example.com" id="link7" target="_blank">Download "example.com"</a></li> 1.47 + <ul> 1.48 + <div id="unload-flag">Okay</div> 1.49 + </body> 1.50 +</html>