StopEdit is a simple JavaScript library designed to keep your webpage safe from unwanted changes. It actively monitors your page for edits and resets everything back to its original state. Whether it's someone tampering with "Inspect Element" or trying to edit your content directly, StopEdit has you covered.
- Features
- Installation
- Usage
- Example
- Options
- How It Works
- Changelog
- To-Do List
- Contributing
- License
- Author
- Customizable Protection: Guard your entire page or just specific elements (default:
<body>
). - Automatic Reversion: Detects unauthorized changes and immediately reverts them.
- Heartbeat Monitoring: Periodic checks to ensure content integrity.
- Debugging Tools: Enables detailed logging in the console for easy debugging.
To install StopEdit, simply download the StopEdit.js
file and include it in your HTML file:
<script src="path/to/StopEdit.js"></script>
Here’s how you can set it up:
<script>
const guard = new StopEdit({
selector: 'body', // Protect the entire page by default
heartbeat: 1000, // Checks every second
debug: true // Logs actions in the console
});
guard.init(); // Start monitoring
</script>
Here’s a complete example to get you started:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>StopEdit Example</title>
</head>
<body>
<h1>Protected Content</h1>
<p>This text is protected. Any changes made to it will be automatically undone.</p>
<!-- Include the StopEdit library -->
<script src="path/to/StopEdit.js"></script>
<script>
const guard = new StopEdit({
selector: 'body',
heartbeat: 1000,
debug: true
});
guard.init();
</script>
</body>
</html>
selector
(default:'body'
): Target specific elements for protection.heartbeat
(default:1000
ms): Set the interval (in milliseconds) for monitoring changes.debug
(default:false
): Turn on logging to track actions in the console.
- Content Backup: When initialized, StopEdit saves a copy of the original content.
- Live Monitoring: It uses
MutationObserver
to track real-time changes. - Regular Checks: Optional heartbeat checks provide an added layer of security.
- Ongoing development and updates.
- Core functionality for monitoring and resetting content.
- Documentation added.
- Browser compatibility testing.
- Improved protection for image URLs.
- Enhanced anti-theft measures for code.
- Prevent copying of page content.
- Server-side integration (PHP, Node.js).
- Detailed online documentation with examples.
We welcome contributions! Whether it’s fixing a bug, adding new features, or improving the documentation, your input is valuable. Here’s how to contribute:
- Fork the repository: Visit the repo here.
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/miragek-stop-edit-js-lib.git
- Create a branch:
git checkout -b feature/your-feature-name
- Make your changes and commit:
git add . git commit -m "Description of your changes"
- Push your changes:
git push origin feature/your-feature-name
- Submit a Pull Request: Open a PR in the main repository.
- Ensure your changes are well-tested.
- Keep your commit messages clear and concise.
- Follow the repository's coding standards.
Have questions? Feel free to open an issue or start a discussion!
StopEdit is licensed under the MIT License. See the LICENSE
file for more details.
Created by Godsent for Miragek
StopEdit is a straightforward solution to protect your webpage content. It’s lightweight, easy to set up, and highly effective. If you have suggestions, questions, or feedback, don’t hesitate to get in touch!