browser_637020_slow.sjs (524B)
1 /* Any copyright is dedicated to the Public Domain. 2 * http://creativecommons.org/publicdomain/zero/1.0/ */ 3 4 const DELAY_MS = "2000"; 5 6 let timer; 7 8 function handleRequest(req, resp) { 9 resp.processAsync(); 10 resp.setHeader("Cache-Control", "no-cache", false); 11 resp.setHeader("Content-Type", "text/html;charset=utf-8", false); 12 13 timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer); 14 timer.init( 15 () => { 16 resp.write("hi"); 17 resp.finish(); 18 }, 19 DELAY_MS, 20 Ci.nsITimer.TYPE_ONE_SHOT 21 ); 22 }