@@ -175,7 +175,8 @@ class LongPollSocket {
175
175
176
176
this . connid = parseInt ( res ) ;
177
177
dummy_tmout = 100 ; // when establishing connection, wait a bit longer to submit dummy package
178
- console . log ( `Get new longpoll connection with id ${ this . connid } ` ) ;
178
+ if ( settings . Debug )
179
+ console . log ( `Get new longpoll connection with id ${ this . connid } ` ) ;
179
180
if ( isFunc ( this . onopen ) )
180
181
this . onopen ( ) ;
181
182
} else if ( this . connid === 'close' ) {
@@ -659,7 +660,7 @@ class WebWindowHandle {
659
660
if ( this . #state)
660
661
return ;
661
662
662
- if ( ! first_time )
663
+ if ( ! first_time && settings . Debug )
663
664
console . log ( `try connect window again ${ new Date ( ) . toString ( ) } ` ) ;
664
665
665
666
if ( this . #ws) {
@@ -786,14 +787,11 @@ class WebWindowHandle {
786
787
msg = msg . slice ( i4 + 1 ) ;
787
788
788
789
if ( chid === 0 ) {
789
- // console.log(`GET chid=0 message ${msg}`);
790
790
if ( msg === 'CLOSE' ) {
791
791
this . close ( true ) ; // force closing of socket
792
792
this . invokeReceiver ( true , 'onWebsocketClosed' ) ;
793
793
} else if ( msg . indexOf ( 'NEW_KEY=' ) === 0 ) {
794
794
this . #new_key = msg . slice ( 8 ) ;
795
- if ( settings . Debug )
796
- console . log ( 'Got new key' , this . #new_key) ;
797
795
this . storeKeyInUrl ( ) ;
798
796
if ( this . #ask_reload)
799
797
this . askReload ( true ) ;
@@ -813,7 +811,8 @@ class WebWindowHandle {
813
811
this . #ws. onclose = arg => {
814
812
this . #ws = undefined ;
815
813
if ( ( this . #state > 0 ) || ( arg === 'force_close' ) ) {
816
- console . log ( 'websocket closed' ) ;
814
+ if ( settings . Debug )
815
+ console . log ( 'websocket closed' ) ;
817
816
this . #state = 0 ;
818
817
this . invokeReceiver ( true , 'onWebsocketClosed' ) ;
819
818
}
0 commit comments