Permalink
Browse files

Wait for WhichBrowser before we start the testsuite

  • Loading branch information...
1 parent ecce78f commit 9f47a9dd3751abcbde47e35a0cdeb366b43a052f @NielsLeenheer NielsLeenheer committed Nov 24, 2013
Showing with 35 additions and 7 deletions.
  1. +18 −3 index.html
  2. +17 −4 qr.html
View
@@ -190,7 +190,22 @@ <h1 data-i18n><span>HTML<strong>5</strong>test</span> <em>how well does your bro
<script>
<!--
- window.addEventListener('load', function() {
+
+ function waitForWhichBrowser(cb) {
+ var callback = cb;
+
+ function wait() {
+ if (typeof WhichBrowser == 'undefined')
+ window.setTimeout(wait, 100)
+ else
+ callback();
+ }
+
+ wait();
+ }
+
+
+ waitForWhichBrowser(function() {
Browsers = new WhichBrowser({
useFeatures: true,
@@ -225,8 +240,8 @@ <h1 data-i18n><span>HTML<strong>5</strong>test</span> <em>how well does your bro
}
start();
- }, false);
-
+ });
+
function start() {
new Test(function(r) {
View
21 qr.html
@@ -53,16 +53,29 @@
<script>
<!--
- window.addEventListener('load', function() {
-
+
+ function waitForWhichBrowser(cb) {
+ var callback = cb;
+
+ function wait() {
+ if (typeof WhichBrowser == 'undefined')
+ window.setTimeout(wait, 100)
+ else
+ callback();
+ }
+
+ wait();
+ }
+
+ waitForWhichBrowser(function() {
+
Browsers = new WhichBrowser({
useFeatures: true,
detectCamouflage: true
});
start();
- }, false);
-
+ });
function start() {
new Test(function(r) {

0 comments on commit 9f47a9d

Please sign in to comment.