Use with caution!
This Beta is still experimental and the bugs may be present.
To contribute to this Beta, go here: https://github.com/sitexw/FuckAdBlock/issues/34
FuckAdBlock (4.0.0-beta.3)
Online example: fuckadblock.sitexw.fr
(A version with a more correct name exists: BlockAdBlock)
Valid on
- Google Chrome (Windows, Mac, Linux, Android, iOS)
- Mozilla Firefox (Windows, Mac, Linux, Android, iOS)
- Internet Explorer (9+)
- Safari (iOS, Mac, Windows)
- Adblock Browser (Android, iOS)
- The list is really very long...
Install via
Manual:
Download "fuckadblock.min.js" and add it to your site
Bower:
bower install fuckadblock
NPM:
npm install fuckadblock
<<<<<<< HEAD bower install fuckadblock
Code example (basic)
AdBlock detected: loading...>>>>>>> v4.x
Code example (instance and plugin option)
AdBlock detected: loading...
Code example (maximum security)
<!-- The variables used by FuckAdBlock is initialized to be sure that another script has not used --> <!-- Added the attribute "integrity" to be sure that the original script is not modified by an extension or other. --> AdBlock detected: loading...
List of SHA256:
- fuckadblock.js:
sha256-flllputoHvX4pZ2s1ujIJj3Lu1EuRB5TL+6UKpDEx+o=
- fuckadblock.min.js:
sha256-YQPO7mqk9cszSMNteCQ6YaPdRYmlJuR7CG1JP/CUa3s=
More information about the attribute "integrity": Subresource Integrity
Code example (other)
fuckAdBlock;fuckAdBlock;// orfuckAdBlock; fuckAdBlockoptions;
Default options (FuckAdBlock)
// The number of milliseconds at the end of which it is considered that AdBlock is not enabledtimeout: 200
Default options (Plugins)
// Plugin "html" // The number of milliseconds between each checkloopTime: 50// Allow to use its own HTML element for checking// If null, then the plugin itself created the elementbaitElement: null// CSS class used to catch AdBlockbaitClass: 'pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links'// CSS style used to not see the baitbaitClass: 'width:1px!important;height:1px!important;position:absolute!important;left:-10000px!important;top:-1000px!important;'// Chose the area (HTML element) which will add the bait// If null, "window.document.body" usedbaitParent: null // Plugin "http" // Use HTTP detection by AJAX ('ajax') or script tag ('import')baitMode: 'ajax'// The url called for detection// {RANDOM} is replaced by a random number (useful against the cache)baitUrl: '/ad/banner/_adsense_/_adserver/_adview_.ad.json?adzone=top&adsize=300x250&advid={RANDOM}'
Method available
// Allows to set options// @options: objectfuckAdBlockoptions; // Allows to check if AdBlock is enabled// @plugins: array (optional, default: all plugins)// @options: object (optional, options selected plugins)fuckAdBlock; // Allows to add an event if AdBlock is detected// @detected: boolean (true: detected, false: not detected)// @callback: functionfuckAdBlock;
Instance
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.
After that, you are free to create your own instances:
var myFuckAdBlock = ;
Plugin
You can create a plugin like this:
This plugin detects randomly AdBlock. In this case, there is one chance in five that AdBlock is detected.
AdBlock detected: loading...
Plugin list
Here is a list of plugins (official or not):
No plugins for now