Skip to content

Commit

Permalink
feat(减少 checkNodeForAds 检测次数):
Browse files Browse the repository at this point in the history
  • Loading branch information
qixing-jk committed Dec 28, 2024
1 parent bd019f1 commit c7a6841
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions components/GoogleAdsense.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
// 递归检查子节点
Expand Down

0 comments on commit c7a6841

Please sign in to comment.