feat(减少 checkNodeForAds 检测次数):

This commit is contained in:
anime
2024-12-29 01:29:43 +08:00
parent bd019f19a1
commit c7a6841c23

View File

@@ -42,11 +42,7 @@ function getNodesWithAdsByGoogleClass(node) {
// 检查节点及其子节点是否包含 adsbygoogle 类
function checkNodeForAds(node) {
if (
node.nodeType === Node.ELEMENT_NODE &&
node.tagName === 'INS' &&
node.classList.contains('adsbygoogle')
) {
if (node.tagName === 'INS' && node.classList.contains('adsbygoogle')) {
adsNodes.push(node)
} else {
// 递归检查子节点