{"id":13511964,"url":"https://github.com/sitexw/FuckAdBlock","last_synced_at":"2025-03-30T21:31:17.578Z","repository":{"id":9174930,"uuid":"10975137","full_name":"sitexw/FuckAdBlock","owner":"sitexw","description":"Detects ad blockers (AdBlock, ...)","archived":false,"fork":false,"pushed_at":"2024-02-17T10:57:04.000Z","size":79,"stargazers_count":1896,"open_issues_count":18,"forks_count":254,"subscribers_count":78,"default_branch":"master","last_synced_at":"2025-03-22T22:04:30.737Z","etag":null,"topics":["adblock","adblocker","fuckadblock"],"latest_commit_sha":null,"homepage":"fuckadblock.sitexw.fr","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sitexw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2013-06-26T18:08:28.000Z","updated_at":"2025-03-20T11:19:47.000Z","dependencies_parsed_at":"2024-06-18T14:53:19.378Z","dependency_job_id":"5dcc9e36-6c30-4bc7-aa8d-5f08baf06448","html_url":"https://github.com/sitexw/FuckAdBlock","commit_stats":{"total_commits":43,"total_committers":9,"mean_commits":4.777777777777778,"dds":0.7209302325581395,"last_synced_commit":"41af4faebc219b44f84c682b24b57ad1e413b3cb"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitexw%2FFuckAdBlock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitexw%2FFuckAdBlock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitexw%2FFuckAdBlock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sitexw%2FFuckAdBlock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sitexw","download_url":"https://codeload.github.com/sitexw/FuckAdBlock/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246254099,"owners_count":20747948,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["adblock","adblocker","fuckadblock"],"created_at":"2024-08-01T03:01:21.767Z","updated_at":"2025-03-30T21:31:17.572Z","avatar_url":"https://github.com/sitexw.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","Tools"],"sub_categories":[],"readme":"FuckAdBlock (v3.2.1)\n===========\n\nYou can detect nasty ad blockers.\nOnline example: http://sitexw.fr/fuckadblock/\n\n(There is also a project, [BlockAdBlock](https://github.com/sitexw/BlockAdBlock), with a more convenient name)\n\n*Come and see the future of FuckAdBlock: [V4 Beta](https://github.com/sitexw/FuckAdBlock/tree/v4.x)*\n\n\nValid on\n---------------------\n- Google Chrome\n- Mozilla Firefox\n- Internet Explorer (8+)\n- Safari\n- Opera\n\nInstall via\n---------------------\nNPM:\n```\nnpm install fuckadblock\n```\nBower:\n```\nbower install fuckadblock\n```\nCDN :\n```\nhttps://cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.min.js\nhttps://cdn.jsdelivr.net/npm/fuckadblock@3.2.1/fuckadblock.min.js\n```\nIntegrity:\n```\nsha256-4/8cdZfUJoNm8DLRzuKwvhusQbdUqVov+6bVj9ewL7U= (fuckadblock.js)\nsha256-xjwKUY/NgkPjZZBOtOxRYtK20GaqTwUCf7WYCJ1z69w= (fuckadblock.min.js)\n```\n\n\nCode example\n---------------------\nIdeally positioned at the end of `\u003cbody\u003e`.\n```javascript\n// Function called if AdBlock is not detected\nfunction adBlockNotDetected() {\n\talert('AdBlock is not enabled');\n}\n// Function called if AdBlock is detected\nfunction adBlockDetected() {\n\talert('AdBlock is enabled');\n}\n\n// We look at whether FuckAdBlock already exists.\nif(typeof fuckAdBlock !== 'undefined' || typeof FuckAdBlock !== 'undefined') {\n\t// If this is the case, it means that something tries to usurp are identity\n\t// So, considering that it is a detection\n\tadBlockDetected();\n} else {\n\t// Otherwise, you import the script FuckAdBlock\n\tvar importFAB = document.createElement('script');\n\timportFAB.onload = function() {\n\t\t// If all goes well, we configure FuckAdBlock\n\t\tfuckAdBlock.onDetected(adBlockDetected)\n\t\tfuckAdBlock.onNotDetected(adBlockNotDetected);\n\t};\n\timportFAB.onerror = function() {\n\t\t// If the script does not load (blocked, integrity error, ...)\n\t\t// Then a detection is triggered\n\t\tadBlockDetected(); \n\t};\n\timportFAB.integrity = 'sha256-xjwKUY/NgkPjZZBOtOxRYtK20GaqTwUCf7WYCJ1z69w=';\n\timportFAB.crossOrigin = 'anonymous';\n\timportFAB.src = 'https://cdnjs.cloudflare.com/ajax/libs/fuckadblock/3.2.1/fuckadblock.min.js';\n\tdocument.head.appendChild(importFAB);\n}\n```\n\nDefault options\n---------------------\n```javascript\n// At launch, check if AdBlock is enabled\n// Uses the method fuckAdBlock.check()\ncheckOnLoad: true\n\n// At the end of the check, is that it removes all events added ?\nresetOnEnd: true\n\n// The number of milliseconds between each check\nloopCheckTime: 50\n\n// The number of negative checks after which there is considered that AdBlock is not enabled\n// Time (ms) = 50*(5-1) = 200ms (per default)\nloopMaxNumber: 5\n\n// CSS class used by the bait caught AdBlock\nbaitClass: 'pub_300x250 pub_300x250m pub_728x90 text-ad textAd text_ad text_ads text-ads text-ad-links'\n\n// CSS style used to hide the bait of the users\nbaitStyle: 'width: 1px !important; height: 1px !important; position: absolute !important; left: -10000px !important; top: -1000px !important;'\n\n// Displays the debug in the console (available only from version 3.2 and more)\ndebug: false\n```\n\nMethod available\n---------------------\n```javascript\n// Allows to set options\n// #options: string|object\n// #value:   string\nfuckAdBlock.setOption(options, value);\n\n// Manually check if AdBlock is enabled.\n// Returns `true` upon completion of check.\n// Returns `false` if check cannot be performed (eg due to another check in progress).\n// The parameter 'loop' allows checking without loop several times according to the value of 'loopMaxNumber'\n// Example: loop=true  =\u003e time~=200ms (time varies depending on the configuration)\n//          loop=false =\u003e time~=1ms\n// #loop: boolean (default: true)\nfuckAdBlock.check(loop);\n\n// Allows to manually simulate the presence of AdBlock or not\n// #detected: boolean (AdBlock is detected ?)\nfuckAdBlock.emitEvent(detected);\n\n// Allows to clear all events added via methods 'on', 'onDetected' and 'onNotDetected'\nfuckAdBlock.clearEvent();\n\n// Allows to add an event if AdBlock is detected\n// #detected: boolean (true: detected, false: not detected)\n// #fn:       function\nfuckAdBlock.on(detected, fn);\n\n// Similar to fuckAdBlock.on(true|false, fn)\nfuckAdBlock.onDetected(fn);\nfuckAdBlock.onNotDetected(fn);\n```\n\nInstance\n---------------------\n*(Available only from version 3.1 and more)*\nBy default, FuckAdBlock is instantiated automatically.\nTo block this automatic instantiation, simply create a variable \"fuckAdBlock\" with a value (null, false, ...) before importing the script.\n```html\n\u003cscript\u003evar fuckAdBlock = false;\u003c/script\u003e\n\u003cscript src=\"./fuckadblock.js\"\u003e\u003c/script\u003e\n```\nAfter that, you are free to create your own instances:\n```javascript\nfuckAdBlock = new FuckAdBlock;\n// and|or\nmyFuckAdBlock = new FuckAdBlock({\n\tcheckOnLoad: true,\n\tresetOnEnd: true\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitexw%2FFuckAdBlock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsitexw%2FFuckAdBlock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsitexw%2FFuckAdBlock/lists"}