bug1063538_worker.js 587 B

1234567891011121314151617181920212223242526
  1. /**
  2. * Any copyright is dedicated to the Public Domain.
  3. * http://creativecommons.org/publicdomain/zero/1.0/
  4. */
  5. var gJar = "jar:http://example.org/tests/dom/base/test/file_bug945152.jar!/data_big.txt";
  6. var xhr = new XMLHttpRequest({mozAnon: true, mozSystem: true});
  7. var progressFired = false;
  8. xhr.onloadend = function(e) {
  9. postMessage({type: 'finish', progressFired: progressFired });
  10. self.close();
  11. };
  12. xhr.onprogress = function(e) {
  13. if (e.loaded > 0) {
  14. progressFired = true;
  15. xhr.abort();
  16. }
  17. };
  18. onmessage = function(e) {
  19. xhr.open("GET", gJar, true);
  20. xhr.send();
  21. }