File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change 27
27
< script src ="perf.js "> </ script >
28
28
< script >
29
29
( function ( ) {
30
- var useApplet = ! / [ ? & ] n o j a v a = t r u e (?: & | $ ) / . test ( location . search ) ;
30
+ if ( / [ ? & ] n o j a v a = t r u e (?: & | $ ) / . test ( location . search ) ) {
31
+ return ;
32
+ }
33
+ var measured ,
34
+ perfNow ,
35
+ begin = new Date ;
31
36
37
+ // is the applet really needed?
38
+ while ( ! ( measured = new Date - begin ) ) { }
39
+ if ( measured != 1 && ! ( ( perfNow = window . performance ) && typeof ( perfNow . webkitNow || perfNow . now ) == 'function' ) ) {
40
+ // load applet
41
+ document . write ( '<applet code="nano" archive="../vendor/benchmark.js/nano.jar"></applet>' ) ;
42
+ }
43
+ } ( ) ) ;
44
+ </ script >
45
+ < script >
46
+ ( function ( ) {
32
47
function init ( ) {
33
48
var fbUI = document . getElementById ( 'FirebugUI' ) ,
34
49
fbDoc = fbUI && ( fbDoc = fbUI . contentWindow || fbUI . contentDocument ) . document || fbDoc ,
38
53
return setTimeout ( init , 15 ) ;
39
54
}
40
55
fbUI . style . height = fbDoc . body . style . height = fbDoc . documentElement . style . height = '100%' ;
41
-
42
- // give applet time to initialize
43
- lodash . delay ( run , useApplet ? 500 : 15 ) ;
44
- }
45
-
46
- if ( useApplet ) {
47
- // using innerHTML avoids an alert in some versions of IE6
48
- var div = document . createElement ( 'div' ) ;
49
- div . innerHTML = '<applet code=nano archive="../vendor/benchmark.js/nano.jar">' ;
50
- document . body . insertBefore ( div . lastChild , document . body . firstChild ) ;
56
+ setTimeout ( run , 15 ) ;
51
57
}
52
58
53
59
window . onload = init ;
You can’t perform that action at this time.
0 commit comments