Skip to main content

A plugin to disable browser developer tools and other page operation permissions for Dash applications using Dash Hooks.

Project description

dash-disable-devtool-plugin

GitHub PyPI Ruff

A plugin to disable browser developer tools and other page operation permissions for Dash applications using Dash Hooks.

Installation

pip install dash-disable-devtool-plugin

Usage

from dash import Dash
# Import the disable devtool plugin
from dash_disable_devtool_plugin import setup_disable_devtool_plugin

# Enable the disable devtool plugin for the current app
setup_disable_devtool_plugin()

app = Dash(__name__)
# Rest of your app code...

Example

Run the included example. In this basic example, first of all, the normal ways to open the browser developer tools via shortcut keys will be blocked. Even if the browser developer tools are opened through other means, it will be quickly detected, and trigger the default page content clearing and rewriting.

python example.py

API Reference

setup_disable_devtool_plugin()

This function sets up the disable-devtool plugin for your Dash application, preventing users from accessing browser developer tools.

Parameter Type Default Description
script_src str "https://cdn.jsdelivr.net/npm/disable-devtool" Source URL of the disable-devtool script. Alternative CDNs: https://unpkg.com/disable-devtool/disable-devtool.min.js, https://registry.npmmirror.com/disable-devtool/latest/files/disable-devtool.min.js
disable_menu bool False Disables right-click context menu when True.
disable_select bool False Disables text selection when True.
disable_copy bool False Disables copy operations (Ctrl+C) when True.
disable_cut bool False Disables cut operations (Ctrl+X) when True.
disable_paste bool False Disables paste operations (Ctrl+V) when True.
rewrite_html str "The current application disables debugging through developer tools." HTML content replacing the entire page when developer tools are detected.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dash_disable_devtool_plugin-0.1.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dash_disable_devtool_plugin-0.1.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file dash_disable_devtool_plugin-0.1.1.tar.gz.

File metadata

File hashes

Hashes for dash_disable_devtool_plugin-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1e5d446db57d1ec04a0d09f7abe15c9dcdd929fe8316e054b6357ff3f7d84896
MD5 102f8e2a9d51d7dfe5c58c1f0565b4a3
BLAKE2b-256 bd7dcc17d38500ef73c2542fc86806368b8fef8781386f32f29f4447de8fbf99

See more details on using hashes here.

File details

Details for the file dash_disable_devtool_plugin-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for dash_disable_devtool_plugin-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e58708bdce0357322d05029b79766dd90d2ef1d756c354c7f738ea638cdc1c9
MD5 aeb85ea3b29f0c7b4fdc289bab265311
BLAKE2b-256 8770110a3633b07a3d888860aa998cad643f6fef5e892eabf6002900830f7e67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page