(ele)
| 7703 | } |
| 7704 | |
| 7705 | async insertElement(ele) { |
| 7706 | if (!this.insert || !this.insert.parentNode) { |
| 7707 | this.getInsert(); |
| 7708 | } |
| 7709 | if (this.insert && this.insert.parentNode) { |
| 7710 | let self = this; |
| 7711 | if (ele.nodeName == "#document-fragment") { |
| 7712 | [].forEach.call(ele.children, el => { |
| 7713 | self.addedElePool.push(el); |
| 7714 | }); |
| 7715 | } else { |
| 7716 | this.addedElePool.push(ele); |
| 7717 | } |
| 7718 | if (this.curSiteRule.insertPos == 2 || this.curSiteRule.insertPos == "in") { |
| 7719 | await this.addElementsInBatches(ele, child => { |
| 7720 | self.insert.appendChild(child); |
| 7721 | }); |
| 7722 | } else { |
| 7723 | await this.addElementsInBatches(ele, child => { |
| 7724 | self.insert.parentNode.insertBefore(child, self.insert); |
| 7725 | }); |
| 7726 | } |
| 7727 | } |
| 7728 | } |
| 7729 | |
| 7730 | async addElementsInBatches(ele, appendCall) { |
| 7731 | if (ele.nodeName !== "#document-fragment") { |
no test coverage detected