(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();
}
})();
A CAR expert has revealed their easy hacks to help you save thousands of pounds on your insurance.
A TikTok user called Cameron has dedicated his account to sharing useful hints and tips on trying to save money.
During the cost of living crisis, it's more important than ever to cut costs where possible and save where you can.
And one thing most Brits are paying out for is car insurance.
š For more insights, check out this resource.
Unavoidable bills like this can burn a bit of a hole in your pocket if you don't pay them in efficient ways.
Cameron has now shared the best ways to pay it that will save you the most money.
š Discover more in this in-depth guide.
In a video posted to his nearly 500k followers, he said: "Use these hacks to get cheap car insurance."
He explained in the skit that you can add a named driver who has plenty years of experience to your policy which will help bring costs down.
Cameron also advised when asked where the motor would be parked, you should tell the company it will be "on the driveway which is the cheapest option" - not the street or in the garage.
The third hack was to never insure the car instantly.
Finance guru Cameron said: "Start [your insurance policy] in 20 days.
"[They will] overcharge you if you're in a rush to start the insurance."
His final tip was to always pay the cost in full - so the yearly rate - instead of monthly instalments.
Cameron guaranteed this would get you the "best price".
Flooded with comments one user said: "Paying in full may be cheaper but who has that money straight away? Just pay monthly."
Another said: "Can confirm these all work."
You can find out the best insurance type for you and your car as there are different types.
We also have some simple ideas to help drive down your petrol costs.