redirect.html 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <html>
  2. <head>
  3. <title>redirecting...</title>
  4. <script type="text/javascript">
  5. function redirect(aURL)
  6. {
  7. // We create a listener for this event in browser-test.js which will
  8. // get picked up when specifying --flavor=chrome or --flavor=a11y
  9. var event = new CustomEvent("contentEvent", {
  10. bubbles: true,
  11. detail: {
  12. "data": aURL + location.search,
  13. "type": "loadURI"
  14. }
  15. });
  16. document.dispatchEvent(event);
  17. }
  18. function redirectToHarness()
  19. {
  20. redirect("chrome://mochikit/content/harness.xul");
  21. }
  22. function onLoad() {
  23. // Wait for MozAfterPaint, since the listener in browser-test.js is not
  24. // added until then.
  25. window.addEventListener("MozAfterPaint", function testOnMozAfterPaint() {
  26. window.removeEventListener("MozAfterPaint", testOnMozAfterPaint);
  27. setTimeout(redirectToHarness, 0);
  28. // In case the listener was not ready, try again after a few seconds.
  29. setTimeout(redirectToHarness, 5000);
  30. });
  31. }
  32. </script>
  33. </head>
  34. <body onload="onLoad();">
  35. redirecting...
  36. </body>
  37. </html>