All Projects → sitexw → Fuckadblock

sitexw / Fuckadblock

Licence: mit
Detects ad blockers (AdBlock, ...)

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Fuckadblock

just-detect-adblock
It's FuckAdBlock with a minimalist API.
Stars: ✭ 71 (-96.1%)
Mutual labels:  adblock, adblocker, fuckadblock
Youtube Music
YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader)
Stars: ✭ 376 (-79.34%)
Mutual labels:  adblock, adblocker
Ttv aderaser
TTV AdEraser aims to remove livestream ads as well as add some useful features to our favourite streaming site.
Stars: ✭ 122 (-93.3%)
Mutual labels:  adblock, adblocker
Hosts.extras
Extra rules for https://github.com/StevenBlack/hosts project
Stars: ✭ 120 (-93.41%)
Mutual labels:  adblock, adblocker
Begoneads
BeGoneAds is a script that puts some popular hosts file lists into the systems hosts file as a adblocker measure.
Stars: ✭ 314 (-82.75%)
Mutual labels:  adblock, adblocker
Resilience
Resilience is an ad blocker for your computer.
Stars: ✭ 379 (-79.18%)
Mutual labels:  adblock, adblocker
Blocky
Fast and lightweight DNS proxy as ad-blocker for local network with many features
Stars: ✭ 523 (-71.26%)
Mutual labels:  adblock, adblocker
indonesianadblockrules
Filter tambahan untuk EasyList memblokir iklan berbahasa Indonesia dan Malaysia.
Stars: ✭ 93 (-94.89%)
Mutual labels:  adblock, adblocker
Blockparty
Ad Blocker App for iOS, macOS
Stars: ✭ 722 (-60.33%)
Mutual labels:  adblock, adblocker
Addon Pi Hole
Pi-hole - Home Assistant Community Add-ons
Stars: ✭ 120 (-93.41%)
Mutual labels:  adblock, adblocker
Hblock
Improve your security and privacy by blocking ads, tracking and malware domains.
Stars: ✭ 724 (-60.22%)
Mutual labels:  adblock, adblocker
Adblocker
Efficient embeddable adblocker library
Stars: ✭ 298 (-83.63%)
Mutual labels:  adblock, adblocker
Kakaotalkadblock
AdBlock for KakaoTalk Desktop Client
Stars: ✭ 283 (-84.45%)
Mutual labels:  adblock, adblocker
Xspotify
A modified Spotify client with DRM bypass.
Stars: ✭ 1,376 (-24.4%)
Mutual labels:  adblock, adblocker
Adblock4limbo
毒奶去广告计划(稳定版)For Quantumult X ;如去奈菲影视/低端影视/片库网/Pornhub/Jable/Netflav等视频网站广告或其他ACG网站广告;
Stars: ✭ 261 (-85.66%)
Mutual labels:  adblock, adblocker
Blacklist
Curated and well-maintained hostfile to block ads, tracking, cryptomining, and more! Updated regularly. ⚡🔒
Stars: ✭ 492 (-72.97%)
Mutual labels:  adblock, adblocker
Pornlist
Ad-blocking porn websites filter list for Adblock Plus and uBlock Origin.
Stars: ✭ 21 (-98.85%)
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 (-95.99%)
Mutual labels:  adblock, adblocker
turk-adlist
Ad servers list to block ads on Turkish websites.
Stars: ✭ 38 (-97.91%)
Mutual labels:  adblock, adblocker
Blockadblock
Allows you to detect the extension AdBlock (and other)
Stars: ✭ 543 (-70.16%)
Mutual labels:  adblock, adblocker

FuckAdBlock (v3.2.1)

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

(There is also a project, BlockAdBlock, with a more convenient name)

Come and see the future of FuckAdBlock: V4 Beta

Valid on

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

Install via

NPM:

npm install fuckadblock

Bower:

bower install fuckadblock

CDN :

https://cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.min.js
https://cdn.jsdelivr.net/npm/[email protected]/fuckadblock.min.js

Integrity:

sha256-4/8cdZfUJoNm8DLRzuKwvhusQbdUqVov+6bVj9ewL7U= (fuckadblock.js)
sha256-xjwKUY/NgkPjZZBOtOxRYtK20GaqTwUCf7WYCJ1z69w= (fuckadblock.min.js)

Code example

Ideally positioned at the end of <body>.

// 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');
}

// We look at whether FuckAdBlock already exists.
if(typeof fuckAdBlock !== 'undefined' || typeof FuckAdBlock !== 'undefined') {
	// If this is the case, it means that something tries to usurp are identity
	// So, considering that it is a detection
	adBlockDetected();
} else {
	// Otherwise, you import the script FuckAdBlock
	var importFAB = document.createElement('script');
	importFAB.onload = function() {
		// If all goes well, we configure FuckAdBlock
		fuckAdBlock.onDetected(adBlockDetected)
		fuckAdBlock.onNotDetected(adBlockNotDetected);
	};
	importFAB.onerror = function() {
		// If the script does not load (blocked, integrity error, ...)
		// Then a detection is triggered
		adBlockDetected(); 
	};
	importFAB.integrity = 'sha256-xjwKUY/NgkPjZZBOtOxRYtK20GaqTwUCf7WYCJ1z69w=';
	importFAB.crossOrigin = 'anonymous';
	importFAB.src = 'https://cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.min.js';
	document.head.appendChild(importFAB);
}

Default options

// At launch, check if AdBlock is enabled
// Uses the method fuckAdBlock.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
fuckAdBlock.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)
fuckAdBlock.check(loop);

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

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

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

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

Instance

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

<script>var fuckAdBlock = false;</script>
<script src="./fuckadblock.js"></script>

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

fuckAdBlock = new FuckAdBlock;
// and|or
myFuckAdBlock = new FuckAdBlock({
	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].