Skip to content

Instantly share code, notes, and snippets.

Created March 8, 2019 12:51
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save wichaksono/ce7d020c11df12dcf876827e7aa7232e to your computer and use it in GitHub Desktop.
document.addEventListener('DOMContentLoaded', init, false);
function init(){
var adblocker = document.getElementById('adblocker-detected');
function adsBlocked(callback){
var testURL = ''
var myInit = {
method: 'HEAD',
mode: 'no-cors'
var myRequest = new Request(testURL, myInit);
fetch(myRequest).then(function(response) {
return response;
}).then(function(response) {
#adblocker-detected {display:none;position: fixed;top: 0px;padding: 10px;background: #2196F3;right: 0;left: 0;text-align: center; color: #fff;font-size: 0.9rem;z-index:9999}{display:block; line-height: 50px;}
<div id="adblocker-detected"><strong>Adblocker Detected : </strong>Dukung ONPHPID dengan menonaktifkan Adblock-mu (^_^) Terima Kasih.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment