()
| 12798 | } |
| 12799 | } |
| 12800 | async function cloneStatus() { |
| 12801 | if (!iframeDoc || ruleParser.curSiteRule.cloneStatus === false) return; |
| 12802 | let inputs = document.querySelectorAll("input:not([type=button],[type=image],[type=reset],[type=submit])"); |
| 12803 | let selectOptions = document.querySelectorAll("select>option"); |
| 12804 | [...inputs].forEach(input => { |
| 12805 | let sel = geneSelector(input, true, true); |
| 12806 | let mirrorEle = iframeDoc.querySelector(sel); |
| 12807 | if (!mirrorEle || !mirrorEle.offsetParent) return; |
| 12808 | if (mirrorEle.type === "checkbox" || mirrorEle.type === "radio") { |
| 12809 | mirrorEle.checked = !!input.checked; |
| 12810 | } else { |
| 12811 | emuInput(mirrorEle, input.value); |
| 12812 | } |
| 12813 | }); |
| 12814 | [...selectOptions].forEach(option => { |
| 12815 | let sel = geneSelector(option, true, true); |
| 12816 | let mirrorEle = iframeDoc.querySelector(sel); |
| 12817 | if (!mirrorEle || !mirrorEle.parentNode.offsetParent) return; |
| 12818 | let selected = option.selected; |
| 12819 | if (mirrorEle.selected === selected) return; |
| 12820 | mirrorEle.selected = !!selected; |
| 12821 | if (selected) { |
| 12822 | mirrorEle.parentNode.dispatchEvent(new Event('change')); |
| 12823 | } |
| 12824 | }); |
| 12825 | if (activeClass) { |
| 12826 | let actives = document.querySelectorAll("." + activeClass); |
| 12827 | for (let active of actives) { |
| 12828 | let sel = geneSelector(active, true, true).replace("." + activeClass, ""); |
| 12829 | let mirrorEle = await waitForElement(sel, iframeDoc, 5000); |
| 12830 | if (!mirrorEle || mirrorEle.classList.contains(activeClass)) { |
| 12831 | continue; |
| 12832 | } |
| 12833 | emuClick(mirrorEle); |
| 12834 | await sleep(300); |
| 12835 | } |
| 12836 | } |
| 12837 | } |
| 12838 | async function checkPage() { |
| 12839 | if (isPause) return loadPageOver(); |
| 12840 | try { |
no test coverage detected