File tree Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Expand file tree Collapse file tree 4 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -72,10 +72,9 @@ exports.init = function(key) {
72
72
enable ( res [ 1 ] )
73
73
var doc = document
74
74
var elem = doc . createElement ( 'textarea' )
75
- elem . style . cssText = 'width:100%;height:300px;overflow:auto;line-height:1.4;background:#333;color:#fff'
75
+ elem . style . cssText = 'width:100%;height:300px;overflow:auto;line-height:1.4;background:#333;color:#fff;font:16px Consolas;border:none '
76
76
var box = doc . body || doc . documentElement
77
77
box . insertBefore ( elem , box . firstChild )
78
-
79
78
exports . log = function ( namespace , arr , color ) {
80
79
var ret = [ '[' + namespace + ']' ]
81
80
var len = arr . length
@@ -89,6 +88,7 @@ exports.init = function(key) {
89
88
ret . push ( val )
90
89
}
91
90
elem . value += ret . join ( ' ' ) + '\n'
91
+ elem . scrollTop = elem . scrollHeight
92
92
}
93
93
94
94
} else if ( global . localStorage && console ) {
Original file line number Diff line number Diff line change @@ -78,10 +78,9 @@ exports.init = function(key) {
78
78
enable ( res [ 1 ] )
79
79
var doc = document
80
80
var elem = doc . createElement ( 'textarea' )
81
- elem . style . cssText = 'width:100%;height:300px;overflow:auto;line-height:1.4;background:#333;color:#fff'
81
+ elem . style . cssText = 'width:100%;height:300px;overflow:auto;line-height:1.4;background:#333;color:#fff;font:16px Consolas;border:none '
82
82
var box = doc . body || doc . documentElement
83
83
box . insertBefore ( elem , box . firstChild )
84
-
85
84
exports . log = function ( namespace , arr , color ) {
86
85
var ret = [ '[' + namespace + ']' ]
87
86
var len = arr . length
@@ -95,6 +94,7 @@ exports.init = function(key) {
95
94
ret . push ( val )
96
95
}
97
96
elem . value += ret . join ( ' ' ) + '\n'
97
+ elem . scrollTop = elem . scrollHeight
98
98
}
99
99
100
100
} else if ( global . localStorage && console ) {
Original file line number Diff line number Diff line change 6
6
< style >
7
7
* {
8
8
margin : 0 ;
9
+ padding : 0 ;
9
10
}
10
11
h1 {
11
12
margin-top : 30px ;
22
23
var b = debug ( 'worker:b' )
23
24
a ( 'init' )
24
25
b ( 'init' )
25
- setInterval ( function ( ) {
26
+ var timer1 = setInterval ( function ( ) {
26
27
a ( 'log some number' , 1024 )
27
28
} , 1000 )
28
29
29
- setInterval ( function ( ) {
30
+ var timer2 = setInterval ( function ( ) {
30
31
b ( 'log some object' , { foo : 'bar' } )
31
32
} , 1200 )
33
+
34
+ setTimeout ( function ( ) {
35
+ clearInterval ( timer1 )
36
+ clearInterval ( timer2 )
37
+ } , 15 * 1000 )
32
38
</ script >
33
39
</ body >
34
40
</ html >
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " min-debug" ,
3
- "version" : " 1.2.2 " ,
3
+ "version" : " 1.2.3 " ,
4
4
"description" : " Debug for browser in console or display on page" ,
5
5
"main" : " debug.js" ,
6
6
"directories" : {
You can’t perform that action at this time.
0 commit comments