Nocturnal Pumpkin Maelstrom

    block-adblock-js
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    block-adblock-js

    Ultra-simple and ultra-lightweight (700 bytes) adblock detection library.

    • Enhanced detection over BlockAdblock
    • TypeScript support
    • Ultra-lightweight file of only 700 bytes

    HowTo

    npm/yarn

    npm i block-adblock-js
    import AdDetect from "block-adblock-js";
    
    if (AdDetect.check()) {
        // with adblock enabled
    }

    CDN

    jsdelivr: https://cdn.jsdelivr.net/npm/block-adblock-js

    <script type="module" defer>
        // Using defer, below scripts run when the DOM is completely built.
        import AdDetect from 'https://cdn.jsdelivr.net/npm/block-adblock-js';
        if (AdDetect.check()) {
            // with adblock enabled
        }
    </script>

    Sample

    Vue

    <script lang="ts">
    import AdDetect from "block-adblock-js";
    
    export default defineComponent({
      mounted() {
        if (AdDetect.check()) {
          alert("Adblock is enabled");
        } else {
          alert("Adblock is disabled or not installed");
        }
      },
    });
    </script>

    Install

    npm i block-adblock-js

    DownloadsWeekly Downloads

    11

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    6.81 kB

    Total Files

    10

    Last publish

    Collaborators

    • ichii731