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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@comptechco/disable-devtool

v0.0.3

Published

Disable web developer tools from the f12 button, right-click and browser

Downloads

111

Readme

@comptechco/disable-devtool

This package helps in disabling developer tools on browsers, preventing users from inspecting or modifying the web page's content through dev tools.

Installation

If not using Jenkins:

Install the package using the following command:

npm install @comptechco/disable-devtool --//registry.npmjs.org/:_authToken=ComptechcoToken

If using Jenkins:

  1. Add the following entry to your package.json:
"@comptechco/disable-devtool": "version"
  1. Create a .npmrc file in the root of your project and add the following content:
//registry.npmjs.org/:_authToken=ComptechcoToken
  1. Run the following command to install the package:
npm i

Usage

Import the package and use it as follows:

import disableDevtool from "@comptechco/disable-devtool";

disableDevtool({
  disableMenu: false,
  url: "assets/html/yourhtmlpage.html",
});

Configuration

You can pass an options object to customize the behavior of the package. Below are the available options:

declare interface IConfig {
  md5?: string; // Bypass disabled MD5 value, bypass disabled by default
  url?: string; // Jump page when closing the page fails, the default value is localhost
  tkName?: string; // Bypass URL parameter name when disabled, default is ddtk
  ondevtoolopen?(type: DetectorType, next: Function): void; // Callback for opening the developer panel
  ondevtoolclose?(): void; // Callback for developer panel close
  interval?: number; // Timer interval, default is 200ms
  disableMenu?: boolean; // Whether to disable the right-click menu, default is true
  stopIntervalTime?: number; // Waiting time to cancel monitoring on mobile
  clearIntervalWhenDevOpenTrigger?: boolean; // Whether to stop monitoring after triggering, default is false
  detectors?: Array<DetectorType>; // Enabled detectors. The default is all, it is recommended to use all
  clearLog?: boolean; // Whether to clear the log every time
  disableSelect?: boolean; // Whether to disable text selection, default is false
  disableCopy?: boolean; // Whether to disable copying, default is false
  disableCut?: boolean; // Whether to disable cutting, default is false
  disablePaste?: boolean; // Whether to disable pasting, default is false
  ignore?: (string | RegExp)[] | null | (() => boolean); // Conditions to ignore the disablement
  disableIframeParents?: boolean; // Whether all parent windows are disabled in the iframe
  timeOutUrl?: string; // URL to forward when the page timeout occurs
  rewriteHTML?: string; // HTML page to rewrite after opening the dev tools
}

DetectorType Enum

enum DetectorType {
  Unknown = -1,
  RegToString = 0, // Check based on regular expression
  DefineId, // Detect based on DOM id
  Size, // Detect based on window size (this probe is not enabled by default)
  DateToString, // Check based on Date.toString
  FuncToString, // Check based on Function.toString
  Debugger, // Detect breakpoints (valid only for iOS Chrome on real devices)
  Performance, // Performance detection based on log big data
  DebugLib, // Detect third-party debugging tools (e.g., eruda, vconsole)
}

License

MIT