| 664 | } |
| 665 | |
| 666 | async function readPPT(remotePage: RemotePage, readSpeed: number) { |
| 667 | const reader = document.querySelector('.ux-pdf-reader'); |
| 668 | if (reader) { |
| 669 | const total = parseInt( |
| 670 | document |
| 671 | .querySelector('.ux-h5pdfreader_container_footer_pages_total') |
| 672 | ?.childNodes[1]?.textContent?.replace(/\s/, '') || '0' |
| 673 | ); |
| 674 | const start = parseInt( |
| 675 | document.querySelector<HTMLInputElement>('.ux-h5pdfreader_container_footer_pages_in')?.value || '1' |
| 676 | ); |
| 677 | for (let index = start; index < total + 1; index++) { |
| 678 | const next = document.querySelector<HTMLElement>('.ux-h5pdfreader_container_footer_pages_next'); |
| 679 | if (next) { |
| 680 | await remotePage.click(next); |
| 681 | } else { |
| 682 | $msg_and_log('error', '未找到PPT的下一页按钮!'); |
| 683 | } |
| 684 | await $.sleep(readSpeed * 1000); |
| 685 | } |
| 686 | } |
| 687 | } |
| 688 | |
| 689 | async function discussion( |
| 690 | remotePage: RemotePage, |