{"_id":"fuckadblock","_rev":"7-2def17d4a2f2fe0d674d848fa6196c09","name":"fuckadblock","description":"Detects ad blockers (AdBlock, ...)","dist-tags":{"latest":"3.2.1"},"versions":{"3.1.0":{"name":"fuckadblock","version":"3.1.0","description":"Detects ad blockers (AdBlock, ...)","author":{"name":"Valentin Allaire","email":"valentin.allaire@sitexw.fr","url":"http://sitexw.fr/"},"license":"MIT","keywords":["adblock","advertising","ad","block","lock","detection","detecting"],"main":"fuckadblock.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"homepage":"https://github.com/sitexw/FuckAdBlock","repository":{"type":"git","url":"git://github.com/sitexw/FuckAdBlock.git"},"bugs":{"url":"https://github.com/sitexw/FuckAdBlock/issues"},"gitHead":"92c0149a21ccdfb2a38bb9ba8607761d0a014d5c","_id":"fuckadblock@3.1.0","_shasum":"ce4292a1431befb99de3ee46df71b4c88d29ed32","_from":".","_npmVersion":"2.7.3","_nodeVersion":"0.12.2","_npmUser":{"name":"sitexw","email":"sitexw@gmail.com"},"maintainers":[{"name":"sitexw","email":"sitexw@gmail.com"}],"dist":{"shasum":"ce4292a1431befb99de3ee46df71b4c88d29ed32","tarball":"https://registry.npmjs.org/fuckadblock/-/fuckadblock-3.1.0.tgz","integrity":"sha512-vOGZ80zFD4/vapxbdM3nwro3akMHllGVB7Vn01SjnO3Ydifo21rd5W0548XZvc40BDBqv3nITtwomWjdFGVPuQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDDaorHqlIK1LkDoKEYULyVmgJe9MXjhbqcTUykzK/uvAiEAgcG7Q6klNChg4ZC265EbhHXay0V0udFV80lQ90dWC90="}]}},"3.1.1":{"name":"fuckadblock","version":"3.1.1","description":"Detects ad blockers (AdBlock, ...)","author":{"name":"Valentin Allaire","email":"valentin.allaire@sitexw.fr","url":"http://sitexw.fr/"},"license":"MIT","keywords":["adblock","advertising","ad","block","lock","detection","detecting"],"main":"fuckadblock.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"homepage":"https://github.com/sitexw/FuckAdBlock","repository":{"type":"git","url":"git://github.com/sitexw/FuckAdBlock.git"},"bugs":{"url":"https://github.com/sitexw/FuckAdBlock/issues"},"gitHead":"1a29bed9f29da3811f6f5518b1bd6d9d827160a9","_id":"fuckadblock@3.1.1","_shasum":"95f3546e5e7a0563f13252fff197fd1738944cdb","_from":".","_npmVersion":"2.9.0","_nodeVersion":"0.12.2","_npmUser":{"name":"sitexw","email":"sitexw@gmail.com"},"maintainers":[{"name":"sitexw","email":"sitexw@gmail.com"}],"dist":{"shasum":"95f3546e5e7a0563f13252fff197fd1738944cdb","tarball":"https://registry.npmjs.org/fuckadblock/-/fuckadblock-3.1.1.tgz","integrity":"sha512-9CMO2NKpPcsf3poE8dfFTVXNSoWFz8qBWK0xA9sGUSsDWjG1lKgJaGkq76gP/Kj6Q0fZCkmkRxo4k+frARtlYw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICwHf+1pxMm2aOPb/LoE2XN2WNhFroBL4wjqHkqLWTsvAiEAzYMD1+10Hj3fXamIjWxPnr7nkrVx8jG75ObrzfVBtOk="}]}},"3.2.0":{"name":"fuckadblock","version":"3.2.0","description":"Detects ad blockers (AdBlock, ...)","author":{"name":"Valentin Allaire","email":"valentin.allaire@sitexw.fr","url":"http://sitexw.fr/"},"license":"MIT","keywords":["adblock","advertising","ad","block","lock","detection","detecting"],"main":"fuckadblock.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"homepage":"https://github.com/sitexw/FuckAdBlock","repository":{"type":"git","url":"git://github.com/sitexw/FuckAdBlock.git"},"bugs":{"url":"https://github.com/sitexw/FuckAdBlock/issues"},"gitHead":"215cb762e0ebdbafdac810bfc1ac88920786ac4a","_id":"fuckadblock@3.2.0","_shasum":"aaf2f5412f5cf3089219e460b296f9774423e5a9","_from":".","_npmVersion":"2.12.1","_nodeVersion":"0.12.6","_npmUser":{"name":"sitexw","email":"sitexw@gmail.com"},"maintainers":[{"name":"sitexw","email":"sitexw@gmail.com"}],"dist":{"shasum":"aaf2f5412f5cf3089219e460b296f9774423e5a9","tarball":"https://registry.npmjs.org/fuckadblock/-/fuckadblock-3.2.0.tgz","integrity":"sha512-O+JUOBhbuPvTrh4+8Z18uAXS0X4dMNl/m4k+f+jYSc+psrJg88qcMDXIGMw2gxCswGa1K8q+b/DKADyOMrmkGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDdTS7YU6f8jH5tHXx4Dn+ahClnsI4FDgEbvyEun8U+YgIhAIeDnAcaZyeG6khGzBUJT+TEVk56aYjeRvPQCgS9zvGl"}]}},"3.2.1":{"name":"fuckadblock","version":"3.2.1","description":"Detects ad blockers (AdBlock, ...)","author":{"name":"Valentin Allaire","email":"valentin.allaire@sitexw.fr","url":"http://sitexw.fr/"},"license":"MIT","keywords":["adblock","advertising","ad","block","lock","detection","detecting"],"main":"fuckadblock.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"homepage":"https://github.com/sitexw/FuckAdBlock","repository":{"type":"git","url":"git://github.com/sitexw/FuckAdBlock.git"},"bugs":{"url":"https://github.com/sitexw/FuckAdBlock/issues"},"gitHead":"da20a526928e4921691f7d693a1988f2e345d997","_id":"fuckadblock@3.2.1","_shasum":"17fa3237a5e15c86613406b911e608191a3e62e2","_from":".","_npmVersion":"2.12.1","_nodeVersion":"5.6.0","_npmUser":{"name":"sitexw","email":"sitexw@gmail.com"},"maintainers":[{"name":"sitexw","email":"sitexw@gmail.com"}],"dist":{"shasum":"17fa3237a5e15c86613406b911e608191a3e62e2","tarball":"https://registry.npmjs.org/fuckadblock/-/fuckadblock-3.2.1.tgz","integrity":"sha512-XTpOsBqx6yryVbd3iMyMXCfOutFvwLxApCcZ20iDjbrAikHjFZrObhA2mYdXGUjXsL1mv9Hz/97y0VyzmgjnDw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFENN3As0ZrXXMtcy4Y1p7E5p8r3jRMd3Rez8R6MSvztAiBd/JyoWnvz96qI42TjJBjke7VorAQjDz8u/qoGv+tgrg=="}]},"_npmOperationalInternal":{"host":"packages-13-west.internal.npmjs.com","tmp":"tmp/fuckadblock-3.2.1.tgz_1457200931833_0.902983671054244"}}},"readme":"FuckAdBlock (v3.2.1)\r\n===========\r\n\r\nYou can detect nasty ad blockers.\r\nOnline example: http://sitexw.fr/fuckadblock/\r\n\r\n(There is also a project, [BlockAdBlock](https://github.com/sitexw/BlockAdBlock), with a more convenient name)\r\n\r\n*Come and see the future of FuckAdBlock: [V4 Beta](https://github.com/sitexw/FuckAdBlock/tree/v4.x)*\r\n\r\n\r\nValid on\r\n---------------------\r\n- Google Chrome\r\n- Mozilla Firefox\r\n- Internet Explorer (8+)\r\n- Safari\r\n- Opera\r\n\r\nInstall via\r\n---------------------\r\nManual:\r\n```\r\nDownload \"fuckadblock.js\" and add it to your website.\r\n```\r\nBower:\r\n```\r\nbower install fuckadblock\r\n```\r\nNode.js/io.js:\r\n```\r\nnpm install fuckadblock\r\n```\r\n\r\n\r\nCode example\r\n---------------------\r\n```javascript\r\n// Function called if AdBlock is not detected\r\nfunction adBlockNotDetected() {\r\n\talert('AdBlock is not enabled');\r\n}\r\n// Function called if AdBlock is detected\r\nfunction adBlockDetected() {\r\n\talert('AdBlock is enabled');\r\n}\r\n\r\n// Recommended audit because AdBlock lock the file 'fuckadblock.js' \r\n// If the file is not called, the variable does not exist 'fuckAdBlock'\r\n// This means that AdBlock is present\r\nif(typeof fuckAdBlock === 'undefined') {\r\n\tadBlockDetected();\r\n} else {\r\n\tfuckAdBlock.onDetected(adBlockDetected);\r\n\tfuckAdBlock.onNotDetected(adBlockNotDetected);\r\n\t// and|or\r\n\tfuckAdBlock.on(true, adBlockDetected);\r\n\tfuckAdBlock.on(false, adBlockNotDetected);\r\n\t// and|or\r\n\tfuckAdBlock.on(true, adBlockDetected).onNotDetected(adBlockNotDetected);\r\n}\r\n\r\n// Change the options\r\nfuckAdBlock.setOption('checkOnLoad', false);\r\n// and|or\r\nfuckAdBlock.setOption({\r\n\tdebug: true,\r\n\tcheckOnLoad: false,\r\n\tresetOnEnd: false\r\n});\r\n```\r\n\r\nDefault options\r\n---------------------\r\n```javascript\r\n// At launch, check if AdBlock is enabled\r\n// Uses the method fuckAdBlock.check()\r\ncheckOnLoad: true\r\n\r\n// At the end of the check, is that it removes all events added ?\r\nresetOnEnd: true\r\n\r\n// The number of milliseconds between each check\r\nloopCheckTime: 50\r\n\r\n// The number of negative checks after which there is considered that AdBlock is not enabled\r\n// Time (ms) = 50*(5-1) = 200ms (per default)\r\nloopMaxNumber: 5\r\n\r\n// CSS class used by the bait caught AdBlock\r\nbaitClass: 'pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links'\r\n\r\n// CSS style used to hide the bait of the users\r\nbaitStyle: 'width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;'\r\n\r\n// Displays the debug in the console (available only from version 3.2 and more)\r\ndebug: false\r\n```\r\n\r\nMethod available\r\n---------------------\r\n```javascript\r\n// Allows to set options\r\n// #options: string|object\r\n// #value:   string\r\nfuckAdBlock.setOption(options, value);\r\n\r\n// Allows to check if AdBlock is enabled\r\n// The parameter 'loop' allows checking without loop several times according to the value of 'loopMaxNumber'\r\n// Example: loop=true  => time~=200ms (time varies depending on the configuration)\r\n//          loop=false => time~=1ms\r\n// #loop: boolean (default: true)\r\nfuckAdBlock.check(loop);\r\n\r\n// Allows to manually simulate the presence of AdBlock or not\r\n// #detected: boolean (AdBlock is detected ?)\r\nfuckAdBlock.emitEvent(detected);\r\n\r\n// Allows to clear all events added via methods 'on', 'onDetected' and 'onNotDetected'\r\nfuckAdBlock.clearEvent();\r\n\r\n// Allows to add an event if AdBlock is detected\r\n// #detected: boolean (true: detected, false: not detected)\r\n// #fn:       function\r\nfuckAdBlock.on(detected, fn);\r\n\r\n// Similar to fuckAdBlock.on(true|false, fn)\r\nfuckAdBlock.onDetected(fn);\r\nfuckAdBlock.onNotDetected(fn);\r\n```\r\n\r\nInstance\r\n---------------------\r\n*(Available only from version 3.1 and more)*\r\nBy default, FuckAdBlock is instantiated automatically.\r\nTo block this automatic instantiation, simply create a variable \"fuckAdBlock\" with a value (null, false, ...) before importing the script.\r\n```html\r\n<script>var fuckAdBlock = false;</script>\r\n<script src=\"./fuckadblock.js\"></script>\r\n```\r\nAfter that, you are free to create your own instances:\r\n```javascript\r\nfuckAdBlock = new FuckAdBlock;\r\n// and|or\r\nmyFuckAdBlock = new FuckAdBlock({\r\n\tcheckOnLoad: true,\r\n\tresetOnEnd: true\r\n});\r\n```\r\n","maintainers":[{"name":"sitexw","email":"sitexw@gmail.com"}],"time":{"modified":"2022-06-18T04:05:28.932Z","created":"2015-04-17T14:01:06.460Z","3.1.0":"2015-04-17T14:01:06.460Z","3.1.1":"2015-06-03T08:13:06.552Z","3.2.0":"2015-09-03T09:58:07.491Z","3.2.1":"2016-03-05T18:02:15.031Z"},"homepage":"https://github.com/sitexw/FuckAdBlock","keywords":["adblock","advertising","ad","block","lock","detection","detecting"],"repository":{"type":"git","url":"git://github.com/sitexw/FuckAdBlock.git"},"author":{"name":"Valentin Allaire","email":"valentin.allaire@sitexw.fr","url":"http://sitexw.fr/"},"bugs":{"url":"https://github.com/sitexw/FuckAdBlock/issues"},"license":"MIT","readmeFilename":"README.md","users":{"sitexw":true}}