Tuesday, August 11, 2020

Deteksi adblock dengan menggunkan javascript

img
 

1. index.html


<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<SCRIPT LANGUAGE="JavaScript" SRC="script.js"></SCRIPT>
<link rel="stylesheet" type="text/css" href="style.css" />
<title>Adblock Detector JavaScript</title>
</head>
<body>
<div id="wrapfabtest">
<div class="adBanner">
This is an ad
</div>
</div>
</body>
</html>


2. script.js

$(document).ready(function(){
if($("#wrapfabtest").height() > 0) {
alert('No AdBlock :)');
} else {
alert('AdBlock Detected ');
}
});


3. style.css

#wrapfabtest {
}
.adBanner {
background-color: transparent;
height: 1px;
width: 1px;
}

4. jquery.min.js

No comments:

Post a Comment

Set Cookie dan Remove Cookie dengan php vanilla.js

< html lang = "en" > < head >     < meta charset = "UTF-8" >     < meta name = "viewport...