content/base/test/file_bug503473-frame.sjs

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 function handleRequest(request, response) {
     2   response.processAsync();
     3   response.setStatusLine(request.httpVersion, 200, "OK");
     4   response.setHeader("Content-Type", "text/html; charset=utf-8", false);
     5   response.setHeader("Cache-Control", "no-cache", false);
     7   response.write(
     8     '<!DOCTYPE html>' +
     9     '<div></div>' +
    10     '<script>' +
    11     'function doWrite() {' +
    12     '  document.write("<p></p>");' +
    13     '  parent.done();' +
    14     '  document.close();' +
    15     '}' +
    16     'setTimeout(doWrite, 0);' +
    17     '</script>' 
    18   );
    20   response.bodyOutputStream.flush();
    21   // leave the stream open
    22 }

mercurial