{"_id":"blockadblock","_rev":"7-d3662d87c3c534255f5ee439b6f04202","name":"blockadblock","description":"Detects ad blockers (AdBlock, ...)","dist-tags":{"latest":"3.2.1"},"versions":{"3.1.0":{"name":"blockadblock","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":"blockadblock.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"homepage":"https://github.com/sitexw/BlockAdBlock","repository":{"type":"git","url":"git://github.com/sitexw/BlockAdBlock.git"},"bugs":{"url":"https://github.com/sitexw/BlockAdBlock/issues"},"gitHead":"27e8b2d961d0049d214584ce7039c02080be6d00","_id":"blockadblock@3.1.0","_shasum":"0e5235adf50fc1db1b2b67f22a4fa804a6adc3f0","_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":"0e5235adf50fc1db1b2b67f22a4fa804a6adc3f0","tarball":"https://registry.npmjs.org/blockadblock/-/blockadblock-3.1.0.tgz","integrity":"sha512-KM7bJKwBmWhLF2A0g+6o+gpm+J9VLDCVPEFAQZDtkRR4BUkmCoV1Tg2uuto70IbqWo4GcGrE1gSC139oukV+IQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4R6NLoV8D4D6kwHkHG+pHfq1bmtKuqvx4cXRplHU+/QIhAMs2T/K9GG8CWNvOKsavZamHwrL+hnW6gqe6h9wNgQpo"}]}},"3.1.1":{"name":"blockadblock","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":"blockadblock.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"homepage":"https://github.com/sitexw/BlockAdBlock","repository":{"type":"git","url":"git://github.com/sitexw/BlockAdBlock.git"},"bugs":{"url":"https://github.com/sitexw/BlockAdBlock/issues"},"gitHead":"26d138eb0f05727a58bd68f0e19af2b16b28b9ab","_id":"blockadblock@3.1.1","_shasum":"0c23f3f9b4037b45710d06ad6a4dd7745c353d75","_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":"0c23f3f9b4037b45710d06ad6a4dd7745c353d75","tarball":"https://registry.npmjs.org/blockadblock/-/blockadblock-3.1.1.tgz","integrity":"sha512-tVpbIU4LK+dmXEVn0Yop0rW7JWXHAcyjB70MMeSUpT0aSzqbfDy25pbzpAa3QCDeKOcWTdQcTuu3cmhhxuOFXQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJS7ewjlkz/l+3Cqpn42zRDugY/vxgblsXF+kt8DBiRAiBVaif7sFKrzhOCH87jPDVWIiaEGgmrNn6Y3f2xyA/fcA=="}]}},"3.2.0":{"name":"blockadblock","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":"blockadblock.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"homepage":"https://github.com/sitexw/BlockAdBlock","repository":{"type":"git","url":"git://github.com/sitexw/BlockAdBlock.git"},"bugs":{"url":"https://github.com/sitexw/BlockAdBlock/issues"},"gitHead":"c01bcfcc5261c558b2dd05604f7a74305bf7f07f","_id":"blockadblock@3.2.0","_shasum":"6c28f3802928d36584da2c01c2f68b76cd2ec925","_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":"6c28f3802928d36584da2c01c2f68b76cd2ec925","tarball":"https://registry.npmjs.org/blockadblock/-/blockadblock-3.2.0.tgz","integrity":"sha512-r4cBX5jfjN/0U6qzecGEDsO70YvedBVbqEVLSXmut7U+EQIBCjqfeTKKciHRy0XbjcDVFFl/S2/R5kPUgkIbDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCH4hh3aZh/FkUw68rQcw8pDjTWouLMfnrwDcBZtH4PoAIhAKU1V0geatiCUSkR0ewkFN280QZCOT9MnjvNAR89p4mM"}]}},"3.2.1":{"name":"blockadblock","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":"blockadblock.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"homepage":"https://github.com/sitexw/BlockAdBlock","repository":{"type":"git","url":"git://github.com/sitexw/BlockAdBlock.git"},"bugs":{"url":"https://github.com/sitexw/BlockAdBlock/issues"},"gitHead":"b2f6c38797c345f7f2e5eb1f36fc457b690692cf","_id":"blockadblock@3.2.1","_shasum":"888c80a8eb221cc3f1e84a0f066e54c90fe87d66","_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":"888c80a8eb221cc3f1e84a0f066e54c90fe87d66","tarball":"https://registry.npmjs.org/blockadblock/-/blockadblock-3.2.1.tgz","integrity":"sha512-EDHDL+61Jxjmx661b++9PG6HIE8j8fWXOik5oZ01gPsmuQN+n2WtLJg9IX0UT8f5dQVvF1vM7QhJ8wATffn83Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDNjdW+oWR0yvaCFMOIzLAHqR4/dbaBqbhboePNiUT4JAIgHuIpKYI04904mvg/PYyFbHsJ8mmY0hA+/mENjQKTWA8="}]},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/blockadblock-3.2.1.tgz_1457200835504_0.18942595948465168"}}},"readme":"BlockAdBlock (v3.2.1)\r\n===========\r\n\r\n([FuckAdBlock](https://github.com/sitexw/FuckAdBlock) same project but with a more convenient name)\r\n\r\nYou can detect nasty ad blockers.\r\nOnline example: http://sitexw.fr/blockadblock/\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 \"blockadblock.js\" and add it to your website.\r\n```\r\nBower:\r\n```\r\nbower install blockadblock\r\n```\r\nNode.js/io.js:\r\n```\r\nnpm install blockadblock\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 'blockadblock.js' \r\n// If the file is not called, the variable does not exist 'blockAdBlock'\r\n// This means that AdBlock is present\r\nif(typeof blockAdBlock === 'undefined') {\r\n\tadBlockDetected();\r\n} else {\r\n\tblockAdBlock.onDetected(adBlockDetected);\r\n\tblockAdBlock.onNotDetected(adBlockNotDetected);\r\n\t// and|or\r\n\tblockAdBlock.on(true, adBlockDetected);\r\n\tblockAdBlock.on(false, adBlockNotDetected);\r\n\t// and|or\r\n\tblockAdBlock.on(true, adBlockDetected).onNotDetected(adBlockNotDetected);\r\n}\r\n\r\n// Change the options\r\nblockAdBlock.setOption('checkOnLoad', false);\r\n// and|or\r\nblockAdBlock.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 blockAdBlock.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\nblockAdBlock.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\nblockAdBlock.check(loop);\r\n\r\n// Allows to manually simulate the presence of AdBlock or not\r\n// #detected: boolean (AdBlock is detected ?)\r\nblockAdBlock.emitEvent(detected);\r\n\r\n// Allows to clear all events added via methods 'on', 'onDetected' and 'onNotDetected'\r\nblockAdBlock.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\nblockAdBlock.on(detected, fn);\r\n\r\n// Similar to blockAdBlock.on(true|false, fn)\r\nblockAdBlock.onDetected(fn);\r\nblockAdBlock.onNotDetected(fn);\r\n```\r\n\r\nInstance\r\n---------------------\r\n*(Available only from version 3.1 and more)*\r\nBy default, BlockAdBlock is instantiated automatically.\r\nTo block this automatic instantiation, simply create a variable \"blockAdBlock\" with a value (null, false, ...) before importing the script.\r\n```html\r\n<script>var blockAdBlock = false;</script>\r\n<script src=\"./blockadblock.js\"></script>\r\n```\r\nAfter that, you are free to create your own instances:\r\n```javascript\r\nblockAdBlock = new BlockAdBlock;\r\n// and|or\r\nmyBlockAdBlock = new BlockAdBlock({\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-13T04:48:14.267Z","created":"2015-05-03T17:27:47.153Z","3.1.0":"2015-05-03T17:27:47.153Z","3.1.1":"2015-08-19T16:41:37.079Z","3.2.0":"2015-09-03T09:58:19.676Z","3.2.1":"2016-03-05T18:00:38.719Z"},"homepage":"https://github.com/sitexw/BlockAdBlock","keywords":["adblock","advertising","ad","block","lock","detection","detecting"],"repository":{"type":"git","url":"git://github.com/sitexw/BlockAdBlock.git"},"author":{"name":"Valentin Allaire","email":"valentin.allaire@sitexw.fr","url":"http://sitexw.fr/"},"bugs":{"url":"https://github.com/sitexw/BlockAdBlock/issues"},"license":"MIT","readmeFilename":"README.md","users":{"sitexw":true}}