@@ -579,59 +579,28 @@ ${Object.keys(size)
579
579
return '' ;
580
580
}
581
581
582
- async scrollUntilTop ( startPoint ?: Point ) : Promise < void > {
583
- if ( startPoint ) {
584
- const start = { x : startPoint . left , y : startPoint . top } ;
585
- const end = { x : start . x , y : 0 } ;
586
-
587
- await this . mouseDrag ( start , end ) ;
588
- return ;
589
- }
590
-
582
+ async scrollUntilTop ( ) : Promise < void > {
591
583
await repeat ( defaultScrollUntilTimes , ( ) =>
592
584
this . mouseWheel ( 0 , 9999999 , defaultFastScrollDuration ) ,
593
585
) ;
594
586
await sleep ( 1000 ) ;
595
587
}
596
588
597
- async scrollUntilBottom ( startPoint ?: Point ) : Promise < void > {
598
- if ( startPoint ) {
599
- const { height } = await this . size ( ) ;
600
- const start = { x : startPoint . left , y : startPoint . top } ;
601
- const end = { x : start . x , y : height } ;
602
- await this . mouseDrag ( start , end ) ;
603
- return ;
604
- }
605
-
589
+ async scrollUntilBottom ( ) : Promise < void > {
606
590
await repeat ( defaultScrollUntilTimes , ( ) =>
607
591
this . mouseWheel ( 0 , - 9999999 , defaultFastScrollDuration ) ,
608
592
) ;
609
593
await sleep ( 1000 ) ;
610
594
}
611
595
612
- async scrollUntilLeft ( startPoint ?: Point ) : Promise < void > {
613
- if ( startPoint ) {
614
- const start = { x : startPoint . left , y : startPoint . top } ;
615
- const end = { x : 0 , y : start . y } ;
616
- await this . mouseDrag ( start , end ) ;
617
- return ;
618
- }
619
-
596
+ async scrollUntilLeft ( ) : Promise < void > {
620
597
await repeat ( defaultScrollUntilTimes , ( ) =>
621
598
this . mouseWheel ( 9999999 , 0 , defaultFastScrollDuration ) ,
622
599
) ;
623
600
await sleep ( 1000 ) ;
624
601
}
625
602
626
- async scrollUntilRight ( startPoint ?: Point ) : Promise < void > {
627
- if ( startPoint ) {
628
- const { width } = await this . size ( ) ;
629
- const start = { x : startPoint . left , y : startPoint . top } ;
630
- const end = { x : width , y : start . y } ;
631
- await this . mouseDrag ( start , end ) ;
632
- return ;
633
- }
634
-
603
+ async scrollUntilRight ( ) : Promise < void > {
635
604
await repeat ( defaultScrollUntilTimes , ( ) =>
636
605
this . mouseWheel ( - 9999999 , 0 , defaultFastScrollDuration ) ,
637
606
) ;
0 commit comments