Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

just-detect-adblock

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

just-detect-adblock

It's FuckAdBlock with a minimalist API.

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.6K
increased by15.97%
Maintainers
1
Weekly downloads
 
Created
Source

just-detect-adblock :no_entry_sign::detective:

This package was originally inspired copied from BlockAdBlock & FuckAdBlock, then I added features that those don't have. I just didn't like how overly complicated their API was, so I made this, which contains only helper functions that can be called manually. The rest is up to you !

Features

  • can detect browser extensions (like Adblock Plus)
  • can detect Brave browser shields
  • can detect Opera browser adblocker

How to use

npm install just-detect-adblock --save
MethodsReturnDescription
detectAnyAdblocker()Promise(detected=true/false)perform all available checks below until at least one is positive
detectDomAdblocker()Promise(detected=true/false)detect if a browser extension is hiding ads from the DOM
detectBraveShields()Promise(detected=true/false)detect if Brave browser shields seems to be activated
detectOperaAdblocker()Promise(detected=true/false)detect if Opera browser adblocker seems to be activated
DEPRECATED isDetected()true/falseif an adblocker is detected (old behavior only, this method does not detect Brave or Opera adblockers, please use detectAnyAdblocker instead)

Exemples

Webpack

import { detectAnyAdblocker } from 'just-detect-adblock'

detectAnyAdblocker().then((detected) => {
  if(detected){
    // an adblocker is detected
  }
});

Browser

<script type="text/javascript" src="/dist/bundle.umd.js"></script>

<script type="text/javascript">
  justDetectAdblock.detectAnyAdblocker().then(function(detected) {
    if(detected){
      // an adblocker is detected
    }
  });
</script>

Keywords

FAQs

Package last updated on 18 Oct 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc