Description
Detect and display alert when ad block is enabled on a page
Install
npm install blocker-detector
yarn add blocker-detector
Usage
- You can get blocking status
import { BlockerDetector } from 'blocker-detector';
const App = () => {
let blocked = BlockerDetector();
return (
<>
{blocked &&
<span>Display when ad block has been detected</span>
}
</>
);
};
- You can simple display alert
import { BlockerAlert } from 'blocker-detector';
const App = () => (
<BlockerAlert>
<span>Display when ad block has been detected</span>
</BlockerAlert>
);