* @description 打开窗口 * @param url * @returns
(url, title)
| 3580 | * @returns |
| 3581 | */ |
| 3582 | async function openFrame(url, title) { |
| 3583 | // 设置 URL |
| 3584 | frame.src = url; |
| 3585 | // 等待元素 |
| 3586 | await $_('.egg_frame'); |
| 3587 | if (frame.ele) { |
| 3588 | // id |
| 3589 | id.value = generateMix(10); |
| 3590 | // 打开 |
| 3591 | frame.closed = false; |
| 3592 | // 设置标题 |
| 3593 | frame.title = title || ''; |
| 3594 | // 等待页面加载 |
| 3595 | await waitFrameLoaded(frame.ele); |
| 3596 | // 发送窗口 ID |
| 3597 | frame.ele.contentWindow?.postMessage({ id: id.value, closed: false }, url); |
| 3598 | return true; |
| 3599 | } |
| 3600 | return false; |
| 3601 | } |
| 3602 | /** |
| 3603 | * @description 关闭窗口 |
| 3604 | */ |
no test coverage detected