All Projects → sitexw → Blockadblock

sitexw / Blockadblock

Licence: mit
Allows you to detect the extension AdBlock (and other)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Blockadblock

Begoneads
BeGoneAds is a script that puts some popular hosts file lists into the systems hosts file as a adblocker measure.
Stars: ✭ 314 (-42.17%)
Mutual labels:  adblock, adblocker
Resilience
Resilience is an ad blocker for your computer.
Stars: ✭ 379 (-30.2%)
Mutual labels:  adblock, adblocker
CoinHive
A nice friendly simple and easly customizable GUI for coinhives javascript miner to embed onto websites so users of your site can interact with features of the miner on every single page this javascript miner is to help those who have problems with advertisements/advertising/ads popups banners mobile redirects malvertising/malware etc and provid…
Stars: ✭ 58 (-89.32%)
Mutual labels:  adblock, adblocker
just-detect-adblock
It's FuckAdBlock with a minimalist API.
Stars: ✭ 71 (-86.92%)
Mutual labels:  adblock, adblocker
Blacklist
Curated and well-maintained hostfile to block ads, tracking, cryptomining, and more! Updated regularly. ⚡🔒
Stars: ✭ 492 (-9.39%)
Mutual labels:  adblock, adblocker
Wireguard-DNScrypt-VPN-Server
Fast setup wireguard server script, with dnscrypt and adblocking, maleware blocking, more blocking if you need. Use case eg. always on vpn and adblocking on ios or android, and be more secured in unknown networks.
Stars: ✭ 48 (-91.16%)
Mutual labels:  adblock, adblocker
ADios
ADBlocker - Block ADS on Twitch, Spotify and EVERYWHERE via the HOST File, PI-Hole, Adblocker Add-on, DNSMasq, Response Policy Zone and Adguard Services. - ADios ADS !
Stars: ✭ 73 (-86.56%)
Mutual labels:  adblock, adblocker
Sponsorblock
Skip YouTube video sponsors (browser extension)
Stars: ✭ 3,627 (+567.96%)
Mutual labels:  adblock, adblocker
Adblocker
Efficient embeddable adblocker library
Stars: ✭ 298 (-45.12%)
Mutual labels:  adblock, adblocker
indonesianadblockrules
Filter tambahan untuk EasyList memblokir iklan berbahasa Indonesia dan Malaysia.
Stars: ✭ 93 (-82.87%)
Mutual labels:  adblock, adblocker
Twitch Hls Adblock
Block advertisements that are inserted in Twitch streams directly.
Stars: ✭ 242 (-55.43%)
Mutual labels:  adblock, adblocker
Kakaotalkadblock
AdBlock for KakaoTalk Desktop Client
Stars: ✭ 283 (-47.88%)
Mutual labels:  adblock, adblocker
Iosadblocklist
Ultimate Host List for Mobile Adblockers (Focused on iOS)
Stars: ✭ 229 (-57.83%)
Mutual labels:  adblock, adblocker
Youtube Music
YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)
Stars: ✭ 376 (-30.76%)
Mutual labels:  adblock, adblocker
Whitelist
A simple tool to add commonly white listed domains to your Pi-Hole setup.
Stars: ✭ 3,033 (+458.56%)
Mutual labels:  adblock, adblocker
AdClear-Open-Source-Issue-Tracker
Open Source Issue Tracker for AdClear non-root ad blocker for Android
Stars: ✭ 101 (-81.4%)
Mutual labels:  adblock, adblocker
Blocker Database
A global domain based database for NoScript, uBlock, uMatrix & ScriptSafe
Stars: ✭ 127 (-76.61%)
Mutual labels:  adblock, adblocker
Fuckadblock
Detects ad blockers (AdBlock, ...)
Stars: ✭ 1,820 (+235.17%)
Mutual labels:  adblock, adblocker
turk-adlist
Ad servers list to block ads on Turkish websites.
Stars: ✭ 38 (-93%)
Mutual labels:  adblock, adblocker
Blocky
Fast and lightweight DNS proxy as ad-blocker for local network with many features
Stars: ✭ 523 (-3.68%)
Mutual labels:  adblock, adblocker

BlockAdBlock (v3.2.1)

(FuckAdBlock same project but with a more convenient name)

You can detect nasty ad blockers. Online example: http://sitexw.fr/blockadblock/

Valid on

  • Google Chrome
  • Mozilla Firefox
  • Internet Explorer (8+)
  • Safari
  • Opera

Install via

Manual:

Download "blockadblock.js" and add it to your website.

Bower:

bower install blockadblock

Node.js/io.js:

npm install blockadblock

Code example

// Function called if AdBlock is not detected
function adBlockNotDetected() {
	alert('AdBlock is not enabled');
}
// Function called if AdBlock is detected
function adBlockDetected() {
	alert('AdBlock is enabled');
}

// Recommended audit because AdBlock lock the file 'blockadblock.js' 
// If the file is not called, the variable does not exist 'blockAdBlock'
// This means that AdBlock is present
if(typeof blockAdBlock === 'undefined') {
	adBlockDetected();
} else {
	blockAdBlock.onDetected(adBlockDetected);
	blockAdBlock.onNotDetected(adBlockNotDetected);
	// and|or
	blockAdBlock.on(true, adBlockDetected);
	blockAdBlock.on(false, adBlockNotDetected);
	// and|or
	blockAdBlock.on(true, adBlockDetected).onNotDetected(adBlockNotDetected);
}

// Change the options
blockAdBlock.setOption('checkOnLoad', false);
// and|or
blockAdBlock.setOption({
	debug: true,
	checkOnLoad: false,
	resetOnEnd: false
});

Default options

// At launch, check if AdBlock is enabled
// Uses the method blockAdBlock.check()
checkOnLoad: true

// At the end of the check, is that it removes all events added ?
resetOnEnd: true

// The number of milliseconds between each check
loopCheckTime: 50

// The number of negative checks after which there is considered that AdBlock is not enabled
// Time (ms) = 50*(5-1) = 200ms (per default)
loopMaxNumber: 5

// CSS class used by the bait caught AdBlock
baitClass: 'pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links'

// CSS style used to hide the bait of the users
baitStyle: 'width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;'

// Displays the debug in the console (available only from version 3.2 and more)
debug: false

Method available

// Allows to set options
// #options: string|object
// #value:   string
blockAdBlock.setOption(options, value);

// Manually check if AdBlock is enabled.
// Returns `true` upon completion of check.
// Returns `false` if check cannot be performed (eg due to another check in progress).
// The parameter 'loop' allows checking without loop several times according to the value of 'loopMaxNumber'
// Example: loop=true  => time~=200ms (time varies depending on the configuration)
//          loop=false => time~=1ms
// #loop: boolean (default: true)
blockAdBlock.check(loop);

// Allows to manually simulate the presence of AdBlock or not
// #detected: boolean (AdBlock is detected ?)
blockAdBlock.emitEvent(detected);

// Allows to clear all events added via methods 'on', 'onDetected' and 'onNotDetected'
blockAdBlock.clearEvent();

// Allows to add an event if AdBlock is detected
// #detected: boolean (true: detected, false: not detected)
// #fn:       function
blockAdBlock.on(detected, fn);

// Similar to blockAdBlock.on(true|false, fn)
blockAdBlock.onDetected(fn);
blockAdBlock.onNotDetected(fn);

Instance

(Available only from version 3.1 and more) By default, BlockAdBlock is instantiated automatically. To block this automatic instantiation, simply create a variable "blockAdBlock" with a value (null, false, ...) before importing the script.

<script>var blockAdBlock = false;</script>
<script src="./blockadblock.js"></script>

After that, you are free to create your own instances:

blockAdBlock = new BlockAdBlock;
// and|or
myBlockAdBlock = new BlockAdBlock({
	checkOnLoad: true,
	resetOnEnd: true
});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].