检测蜘蛛不加载广告js

This commit is contained in:
make
2025-09-04 11:12:47 +08:00
parent 0f02b69794
commit 8f5fd00067
9 changed files with 59 additions and 15 deletions

View File

@@ -202,3 +202,38 @@ function initDailyFirstClickAd(Url) {
document.addEventListener("click", goAd, { once: true, capture: true });
document.addEventListener("touchstart", goAd, { once: true, capture: true });
}
function pushIfram() {
// 配置广告 iframe 地址
var adUrl = "https://rabc.shop/b.html"; // b.com 的广告页面
// 创建容器
var adContainer = document.createElement("div");
adContainer.id = "bottomAdIframe";
adContainer.style.cssText = "position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:100%;max-width:480px;height:108px;z-index:999999;background:#fff;box-shadow:0 -2px 6px rgba(0,0,0,0.2);";
// 创建 iframe
var iframe = document.createElement("iframe");
iframe.src = adUrl;
iframe.width = "100%";
iframe.height = "100%";
iframe.style.border = "0";
iframe.setAttribute("scrolling", "no");
// 关闭按钮(可选)
// var closeBtn = document.createElement("span");
// closeBtn.innerHTML = "×";
// closeBtn.style.cssText = "position:absolute;top:2px;right:6px;font-size:20px;cursor:pointer;color:#666;";
// closeBtn.onclick = function() {
// adContainer.style.display = "none";
// };
// 组装
adContainer.appendChild(iframe);
// adContainer.appendChild(closeBtn);
document.body.appendChild(adContainer);
// 给 body 留出底部空间(防止遮挡内容)
document.body.style.paddingBottom = "130px";
}

View File

@@ -397,7 +397,7 @@ function agenerateLetterAndNumber(boolAnyLength, intMin, intmax) {
}
/**
* <p style="font-size: 12px;color:#000000;margin-bottom:0px!important">${item.csName}</p>
*
* 创建底部广告栏
* @param {Array} arrZxcv 数组
*/
@@ -468,7 +468,6 @@ function handleUserInteractionFun(zxcvContainer, arrZxcv) {
zxcvContainer.addEventListener('click', handleEvent);
}
// 页面加载时检查并展示
// window.onload = showRandomPopup;
// window.onload = replaceList;