Added ads, adblocker, fixed scrollbar, fixed route and asset links of blog
This commit is contained in:
@@ -129,3 +129,29 @@ window.addEventListener("printFile", function (event) {
|
||||
printWindow.print();
|
||||
printWindow.close();
|
||||
});
|
||||
|
||||
(function detectAdBlockReal() {
|
||||
const bait = document.createElement('div');
|
||||
bait.className = 'adsbygoogle ad-banner ad-unit';
|
||||
bait.style.cssText = 'width: 1px; height: 1px; position: absolute; left: -9999px;';
|
||||
document.body.appendChild(bait);
|
||||
|
||||
setTimeout(() => {
|
||||
const baitBlocked =
|
||||
!bait ||
|
||||
bait.offsetParent === null ||
|
||||
bait.offsetHeight === 0 ||
|
||||
window.getComputedStyle(bait).getPropertyValue('display') === 'none' ||
|
||||
window.getComputedStyle(bait).getPropertyValue('visibility') === 'hidden';
|
||||
|
||||
if (baitBlocked) {
|
||||
const elementShow = document.getElementById('sidebar-magic');
|
||||
elementShow.classList.remove('hidden');
|
||||
window.adBlockDetected = true;
|
||||
} else {
|
||||
window.adBlockDetected = false;
|
||||
}
|
||||
|
||||
bait.remove();
|
||||
}, 100);
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user