npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

malicious-extension-blocker-react

v1.0.7

Published

A React component that detects unwanted Chrome extensions and displays warnings in various UI formats. It helps ensure specific browser extensions do not interfere with your application.

Readme

ExtensionChecker

A React component that detects unwanted Chrome extensions and displays warnings in various UI formats. It helps ensure specific browser extensions do not interfere with your application.

Overview

Many Chrome extensions inject scripts, modify the DOM, or interfere with network requests in ways that can disrupt your application. ExtensionChecker identifies these unwanted extensions and provides a user-facing warning or block message to improve user experience and application reliability.

Features

  • Detects specific Chrome extensions by checking for known files.
  • Provides warnings in multiple UI modes: alert, banner, modal, or block.
  • Supports automatic re-checking at configurable intervals.
  • Fires a callback with the list of detected unwanted extensions.
  • Offers extensive customization for styling and behavior.

How It Works

Target Extensions

The component maintains an internal list of target Chrome extensions. Each extension is identified by its ID, a known file path, and a display name.

Detection

For each extension, the component tries to fetch a known file using the chrome-extension:// protocol. If the fetch succeeds, the extension is considered installed.

Comparison

The detected extensions are compared against the provided list of unwanted extensions. If there is a match, the component triggers a warning in the specified display mode.

Display Modes

The component supports four modes:

  1. Alert
    A small dismissable notification.

  2. Banner
    A persistent message near the bottom of the screen that is dismissable.

  3. Modal
    A full-screen overlay with a centered message that is dismissable.

  4. Block
    A complete screen block that prevents interaction. Not dismissable.

Repeat Checks

Optionally, the component can re-check for extensions at regular intervals.

Customization Options

  • Styling: Customize the appearance using inline styles or additional CSS classes.
  • Extensions: Modify or extend the list of target extensions to detect other specific browser extensions.
  • Behavior: Configure display modes, automatic hiding, and intervals to suit your application's needs.

API Reference

| Prop | Type | Required (Depends on displayMode) | Description | | ---------------------- | ------------------------------------------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | displayMode | "silent" \| "alert" \| "banner" \| "modal" \| "block" | Yes | Determines the behavior of the component: - "silent": No UI, relies on onDetect callback. - "alert", "banner", "modal", "block": Displays a warning (or block) UI. | | onDetect | (detected: string[]) => void | Yes, when displayMode: "silent" | A callback function triggered when one or more unwanted extensions are detected. Required for "silent" mode, optional for other modes. | | unwantedExtensions | string[] | Yes | A list of unwanted extensions to detect. Each extension name must match the name field in the internal targetExtensions array. | | title | string | No | The title to display in the warning UI. Optional for all modes. | | description | string | No | The description text displayed below the title in the warning UI. Optional for all modes. | | autoHideDuration | number | No | Duration in milliseconds after which the alert/banner/modal is automatically hidden. Does not apply to "block" mode or "silent" mode. | | customStyles | React.CSSProperties | No | Custom inline styles for the warning container. | | checkInterval | number | No | Interval in milliseconds for periodic re-checking of unwanted extensions. | | className | string | No | Additional CSS class names for styling purposes. |

FAQ

  1. Does this work in browsers other than Chrome?
    No. This component relies on the chrome-extension:// protocol, which is specific to Chrome-based (Chromium) browsers.

  2. Will it detect extensions in Incognito mode?
    Yes, but only if the extensions are explicitly allowed in Incognito mode by the user.

  3. Can this block or disable extensions?
    No. The component only detects and notifies about unwanted extensions. It does not have the capability to block or uninstall them.

  4. What happens if an extension updates and changes its file structure?
    The detection for that extension may fail. Ensure that the file paths for extensions in the internal list are updated if their structure changes.

License

This component is open-source and available under the MIT License.