Skip to content

Instantly share code, notes, and snippets.

View greenreader9's full-sized avatar
🔎
Searching for cool projects

Greenreader9 greenreader9

🔎
Searching for cool projects
View GitHub Profile
@greenreader9
greenreader9 / AdBlockDetection.html
Last active October 14, 2021 22:11
This simple code detects a ad blockers, and if one is found, it will show a popup, disable scrolling on your website, as well as set the background color to grey! You can use an iframe (Already setup) or use your own HTML code for the popup. Unconvinced? Check out the demo: https://codepen.io/greenreader9/pen/wveVpjv
<!DOCTYPE html>
<!-- TO INTEGRATE ME INTO YOUR WEBSITE, COPY THE DIV WITH THE CLASS "Modal", THE CSS, AND THE JAVSCRIPT AT THE END -->
<!-- licensed under the Creative Commons Attribution 4.0 International license (https://creativecommons.org/licenses/by/4.0/) -->
<html>
<head>
<style>
#Modal {
display: none;