react-adblock-detector
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

react-adblock-detector

npm version

Live Demo Site

Description

Provides you with react hook to detect is an adblocker is enabled.

Example

import './App.css';
import React from 'react';
import { useAdblockDetector } from 'react-adblock-detector';

function App() {

  const [isAdblockCheckComplete, isAdblockerDetected] = useAdblockDetector();

  return (
    <div className="App">
      <header className="App-header">
        {
          isAdblockCheckComplete ? (
            isAdblockerDetected ? "We detected an adblocker" : "No adblocker detected"
          ) : "Checking for adblocker..."
        }
      </header>
    </div>
  );
}

export default App;

Last known good

react-adblock-detector@1.0.1 has been verified to work on the following browsers with version:

Version
Chrome 88.0.4324
Firefox 85.0.0
Chromium Edge 88.0.705
Safari 14.0.2

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i react-adblock-detector

    Weekly Downloads

    291

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    8.5 kB

    Total Files

    12

    Last publish

    Collaborators

    • chaharshubhamsingh