{"id":22642649,"url":"https://github.com/scthakuri/react-adblock-detector","last_synced_at":"2025-04-11T23:22:44.012Z","repository":{"id":193693072,"uuid":"689326126","full_name":"scthakuri/react-adblock-detector","owner":"scthakuri","description":"CHPADBLOCK is the adblock detector package for react. Our package detects most of the adblock extension such as ublock, adblock plus and many more.","archived":false,"fork":false,"pushed_at":"2023-09-14T08:23:37.000Z","size":175,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T17:18:01.480Z","etag":null,"topics":["adblock","adblock-detetcor","anti-adblock","anti-adblocker","react-adblock-detector"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@scthakuri/adblock-detector","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scthakuri.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-09T13:05:27.000Z","updated_at":"2025-02-18T05:28:18.000Z","dependencies_parsed_at":"2023-09-09T14:07:29.601Z","dependency_job_id":null,"html_url":"https://github.com/scthakuri/react-adblock-detector","commit_stats":null,"previous_names":["sureshchand12a/react-adblock-detector"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scthakuri%2Freact-adblock-detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scthakuri%2Freact-adblock-detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scthakuri%2Freact-adblock-detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scthakuri%2Freact-adblock-detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scthakuri","download_url":"https://codeload.github.com/scthakuri/react-adblock-detector/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248493330,"owners_count":21113234,"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","adblock-detetcor","anti-adblock","anti-adblocker","react-adblock-detector"],"created_at":"2024-12-09T05:07:41.813Z","updated_at":"2025-04-11T23:22:43.984Z","avatar_url":"https://github.com/scthakuri.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Ad Block Detector\n\nCHPADBLOCK is the adblock detector package for react. Our package detects most of the adblock extension such as ublock, adblock plus and many more.\n\n**[View Live Demo on Sandbox](https://codesandbox.io/s/async-hill-2gdkmp)**\n\n[![NPM](https://img.shields.io/npm/v/@scthakuri/adblock-detector.svg)](https://www.npmjs.com/package/@scthakuri/adblock-detector)\n[![NPM](https://img.shields.io/npm/dm/@scthakuri/adblock-detector)](https://www.npmjs.com/package/@scthakuri/adblock-detector)\n[![TypeScript](https://img.shields.io/badge/TypeScript-.d.ts-blue.svg)](https://github.com/scthakuri/react-adblock-detector/blob/master/lib/index.d.ts)\n[![Known Vulnerabilities](https://snyk.io/test/github/scthakuri/react-adblock-detector/badge.svg)](https://snyk.io/test/github/scthakuri/react-adblock-detector)\n\n## Features\n\n✅ Adblock Detector Modal\n\n✅ Ease of use\n\n✅ Well-tested\n\n✅ Lightweight\n\n✅ MIT license \n\n### Installation\n\n```bash\n# Via npm:\nnpm i @scthakuri/adblock-detector\n\n# Via yarn:\nyarn add @scthakuri/adblock-detector\n```\n\n### Usage:\n```javascript\n\nimport { DetectAdblock } from '@scthakuri/adblock-detector';\n\nDetectAdblock((detected) =\u003e {\n    if( detected ){\n        // Adblock is detected\n    }else{\n        // Adblock is not detected\n    }\n});\n```\n\n### `\u003cDetectorModal\u003e`\n\nModal to show if adblock is detected\n\n**Props**\n\n- [`theme`] \\(String\\): (`optional`) Any form of valid color code\n- [`title`] \\(String\\): (`optional`) Adblock Detected title\n- [`message`] \\(String\\): (`optional`) Adblock Detected title\n- [`closeBtn`] \\(Boolean\\): (`optional`) Whether to include close button on modal or not\n- [`onModalClose`] \\(Function\\): Modal doesn't automatically close. You have to manually close the modal as show in example below\n- [`reloadBtnText`] \\(String\\): (`Optional`) Text for Reload Button\n\n**Example**\n\n***[View Live Demo on Sandbox](https://codesandbox.io/s/async-hill-2gdkmp)***\n\n```javascript\nimport { useState, useEffect } from 'react';\nimport './App.css';\nimport DetectorModal, { DetectAdblock } from '@scthakuri/adblock-detector'\n\nfunction App() {\n\n    const [startDetect, setStartDetect] = useState(true);\n    const [detected, setDetected] = useState(false);\n    const [showModal, setShowModal] = useState(false);\n\n    useEffect(() =\u003e {\n        if( startDetect ){\n            DetectAdblock((enable) =\u003e {\n                setStartDetect(false);\n                setDetected(enable);\n\n                if( enable ){\n                    setShowModal(true);\n                }\n            });\n        }\n    }, [startDetect])\n\n    return (\n        \u003cdiv className=\"App\"\u003e\n            \u003cdiv style={{\n                flex : 1,\n                display : \"flex\",\n                justifyContent : \"center\",\n                alignItems:\"center\",\n                height : \"100vh\",\n                fontSize : \"2rem\",\n                fontWeight:\"bold\"\n            }}\u003e\n                {\n                    startDetect ? \"Detecting . . .\" :\n                    detected ? \"Detected\" : \"Not Detected\"\n                }\n            \u003c/div\u003e\n\n            {\n                showModal \u0026\u0026 \u003cDetectorModal\n                    onModalClose={() =\u003e setShowModal(false)}\n                    closeBtn\n                /\u003e\n            }\n        \u003c/div\u003e\n    );\n}\n\nexport default App;\n\n```\n\n### Tested With\n\n- ☞ Adblock Plus\n- ☞ Adblock\n- ☞ Adguard\n- ☞ Adremover\n- ☞ Adblock for Chrome™\n- ☞ Brave\n- ☞ Ghostery\n- ☞ uBlocker\n- ☞ uBlock\n- ☞ Ultrablock\n- ☞ Privacy Badger\n- ☞ DuckDuckGo\n- ☞ Disconnect\n- ☞ Microsoft Edge AdBlock extension\n- ☞ Firefox Tracking Protection\n- ☞ uBlock Origin\n- ☞ Fair AdBlocker\n- ☞ Hola ad remover\n- ☞ Comodo AdBlocker\n- ☞ Opera Built-in AdBlock extension","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscthakuri%2Freact-adblock-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscthakuri%2Freact-adblock-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscthakuri%2Freact-adblock-detector/lists"}