A plugin to disable browser developer tools and other page operation permissions for Dash applications using Dash Hooks.
Project description
dash-disable-devtool-plugin
A plugin to disable browser developer tools and other page operation permissions for Dash applications using Dash Hooks. You can check out this project on PyPi at: https://pypi.org/project/dash-disable-devtool-plugin
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dash_disable_devtool_plugin-0.1.0.tar.gz.
File metadata
- Download URL: dash_disable_devtool_plugin-0.1.0.tar.gz
- Upload date:
- Size: 3.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15a274915c8c9ae8d2a435743391fae03bbc32c75e4b2823c5fd2593ee07fc1b
|
|
| MD5 |
ccc982f26d76bfc4091129adbb46f09c
|
|
| BLAKE2b-256 |
b1f2d76dff43935365a6df9352cc023920da420ad2bb57d5e8fd090903577d3b
|
File details
Details for the file dash_disable_devtool_plugin-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dash_disable_devtool_plugin-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0fa21f84a71b6e71cb8cc7cff9750f97ab3ac574b0cbe0cfaf7bb53b2b012fe0
|
|
| MD5 |
4fe830271ffe86ed8fc04c7d0a35017a
|
|
| BLAKE2b-256 |
d3533ef41d978b39fc1fde5da517202d0086d4a1ec29c54cff13021521eadd85
|