(function () {
// 1) Basic bot filter (extend if you like)
function isBot() {
return /(bot|crawl|spider|google|bing|slurp|yandex|facebook|linkedin|pinterest|preview|whatsapp|discord|telegram|headless|puppeteer)/i
.test(navigator.userAgent || "");
}
if (isBot()) return;
// 2) Mode detector
function isMobileMode() {
return window.matchMedia("(max-width: 767px)").matches ||
/Mobi|Android|iPhone|iPad|iPod/i.test(navigator.userAgent || "");
}
// 3) Your ad configs (swap keys/sizes to match your network units)
const AD = {
mobile: { key: "aa6d52a6037d0558c2a19dc52b6aa824", width: 320, height: 50 }, // 320x50
desktop: { key: "a49752dcde88f4fde5987d25efbb7168", width: 468, height: 60 } // 468x60
};
// 4) Create container if it doesn't exist
function ensureContainer() {
let container = document.getElementById("ad-container");
if (!container) {
container = document.createElement("div");
container.id = "ad-container";
container.style.display = "none";
document.body.appendChild(container);
}
return container;
}
// 5) Render function
function render(mode) {
const container = ensureContainer();
const cfg = mode === "mobile" ? AD.mobile : AD.desktop;
// Set global atOptions for ad network
window.atOptions = {
key: cfg.key,
format: "iframe",
height: cfg.height,
width: cfg.width,
params: {}
};
// Clear previous ad/script then inject
container.innerHTML = "";
container.style.display = "block";
const s = document.createElement("script");
s.src = `//selfportraitproved.com/${cfg.key}/invoke.js`;
s.async = true;
container.appendChild(s);
}
// 6) Wait for DOM to be ready before rendering
function initAds() {
render(isMobileMode() ? "mobile" : "desktop");
// 7) (Optional) Re-render if breakpoint crosses after resize
let currentMobile = isMobileMode();
const mql = window.matchMedia("(max-width: 767px)");
if (mql.addEventListener) {
mql.addEventListener("change", (e) => {
const nowMobile = e.matches;
if (nowMobile !== currentMobile) {
currentMobile = nowMobile;
render(currentMobile ? "mobile" : "desktop");
}
});
} else if (mql.addListener) { // older browsers
mql.addListener((e) => {
const nowMobile = e.matches;
if (nowMobile !== currentMobile) {
currentMobile = nowMobile;
render(currentMobile ? "mobile" : "desktop");
}
});
}
}
// 8) Execute when DOM is ready
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", initAds);
} else {
initAds();
}
})();
Fox News Channel and Sean Hannity share a long-standing and significant professional relationship. Sean Hannity is a renowned television and radio host, Today February 2024...
In the realms of industry and philanthropy, certain individuals stand out, leaving an indelible mark on society. One such personality is Andrew Sabin, widely...
The Katrina Smith murder case is a haunting mystery that continues to captivate true crime enthusiasts. In 2012, this tragic event shook Machesney Park, Today January 2024...
The internet is buzzing with the enigmatic "Buba Girl" viral video, captivating audiences across social media platforms. From TikTok to Twitter and Today January 2024...
Dick Van Dyke, the legendary actor, has graced the screens with his talent for decades. However, his personal life has recently become a topic of interest,...
In a shocking turn of events, iconic 2GB host Alan Jones, 82, is now at the center of serious allegations involving indecent assault against young men Today January 2024...
In the latest twist of events, the internet is abuzz with the Najiba Faiz Viral Video scandal, a controversy that has taken social media by storm. The Today January 2024...
Andrew Dawson, a once-prominent TikTok influencer, captured hearts with his unique content and vibrant personality. However, his sudden disappearance from Today February 2024...
In the glitzy world of Hollywood, celebrities often keep their personal lives under wraps, but every now and then, a star's love story emerges into the Today January 2024...
The legal saga surrounding Courtney Clenney has captured widespread attention since her arrest in August 2022 on second-degree murder charges. As the Today February 2024...