Skip to content

Stopedit let's you protects entire page or specific elements from bad guys who use inspect element to trick people

Notifications You must be signed in to change notification settings

miragekdev/miragek-stop-edit-js-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

StopEdit - A Lightweight JavaScript Library to Protect Your Page 🛡️

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.


📚 Table of Contents

  1. Features
  2. Installation
  3. Usage
  4. Example
  5. Options
  6. How It Works
  7. Changelog
  8. To-Do List
  9. Contributing
  10. License
  11. Author

✨ Features

  • 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.

⚙️ Installation

To install StopEdit, simply download the StopEdit.js file and include it in your HTML file:

<script src="path/to/StopEdit.js"></script>

🛠️ Usage

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>

🧩 Example

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>

🔧 Options

  • 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.

🔍 How It Works

  1. Content Backup: When initialized, StopEdit saves a copy of the original content.
  2. Live Monitoring: It uses MutationObserver to track real-time changes.
  3. Regular Checks: Optional heartbeat checks provide an added layer of security.

📜 Changelog

[Unreleased]

  • Ongoing development and updates.

[1.1.0] - Initial Release 🎉

  • Core functionality for monitoring and resetting content.
  • Documentation added.

📝 To-Do List

Current Progress 🚀

  • Browser compatibility testing.
  • Improved protection for image URLs.
  • Enhanced anti-theft measures for code.
  • Prevent copying of page content.

Future Enhancements 🔧

  • Server-side integration (PHP, Node.js).
  • Detailed online documentation with examples.

🤝 Contributing

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:

  1. Fork the repository: Visit the repo here.
  2. Clone your fork:
    git clone https://github.com/YOUR_USERNAME/miragek-stop-edit-js-lib.git
  3. Create a branch:
    git checkout -b feature/your-feature-name
  4. Make your changes and commit:
    git add .
    git commit -m "Description of your changes"
  5. Push your changes:
    git push origin feature/your-feature-name
  6. Submit a Pull Request: Open a PR in the main repository.

Guidelines

  • 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!


📄 License

StopEdit is licensed under the MIT License. See the LICENSE file for more details.


👤 Author

Created by Godsent for Miragek


🚀 Final Notes

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!

About

Stopedit let's you protects entire page or specific elements from bad guys who use inspect element to trick people

Topics

Resources

Stars

Watchers

Forks