Skip to content

ChiR24/solver_ext

Repository files navigation

Smart Solver Logo

Smart Solver Extension

Solve coding problems effortlessly with AI-powered assistance

FeaturesInstallationSetupUsageSupported PlatformsTechnical Details


✨ Features

  • 🚀 Smart Problem Solving - Automatically solves coding problems on:
    • LeetCode
    • GeeksForGeeks (GFG)
    • HackerRank
    • CodeChef
    • And more!
  • 🤖 AI-Powered - Utilizes Google's Gemini AI for intelligent solutions
  • Auto-Solve Mode - Automatically solves problems as you browse
  • 🎯 Multiple Languages - Supports Python, Java, C++, JavaScript and more
  • 🎨 Clean Interface - Modern and intuitive user interface
  • 🔒 CSP Compliant - Works with strict Content Security Policies on platforms like GeeksForGeeks

🔧 Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/Solver_Ext.git
  2. Open Chrome and navigate to:

    chrome://extensions/
    
  3. Enable "Developer mode" in the top right

  4. Click "Load unpacked" and select the extension directory

⚙️ Setup

  1. Get your Gemini API key:

  2. Configure the extension:

    • Click the extension icon in Chrome
    • Enter your API key in the settings
    • Click "Save"

📖 Usage

Manual Solving

  1. Navigate to a problem on any supported platform
  2. Click the extension icon
  3. Click "Solve Problem"
  4. Watch as the solution is automatically applied

Auto-Solve Mode

  1. Click the extension icon
  2. Toggle "Auto-Solve" to ON
  3. Solutions will be automatically applied as you browse problems

Keyboard Shortcut

  • Use the configurable keyboard shortcut (default: Ctrl+Alt+S) to instantly solve the current problem
  • Customize the shortcut in the extension popup

🌐 Supported Platforms

Currently supports:

🔍 Technical Details

GeeksForGeeks Support

The extension includes special handling for GeeksForGeeks' strict Content Security Policy (CSP):

  • Uses direct DOM manipulation instead of script injection
  • Implements a dedicated bridge script for GeeksForGeeks
  • Provides robust editor detection and value setting
  • Handles both Ace editor and textarea inputs

Editor Bridges

The extension uses specialized editor bridges to interact with different code editors:

  • Monaco Editor (used by LeetCode, HackerRank)
  • Ace Editor (used by GeeksForGeeks, CodeChef)
  • CodeMirror (used by various platforms)

CSP Compliance

To work around Content Security Policy restrictions:

  • Avoids inline script execution
  • Uses message passing between content scripts and page context
  • Implements direct DOM manipulation when necessary

🔒 Privacy & Security

  • API keys are stored locally in your browser
  • No data is collected or stored externally
  • All processing happens in your browser

🔍 Troubleshooting

If you encounter issues:

  1. Verify your Gemini API key is valid
  2. Ensure you're on a supported platform
  3. Try refreshing the page
  4. Disable and re-enable the extension
  5. Check the browser console for error messages
Common Error Messages
Error Solution
"API key not found" Enter your Gemini API key in the extension settings
"No code editor found" Make sure you're on a page with a code editor
"Failed to apply solution" Try refreshing the page and waiting for the editor to fully load
"CSP blocked script execution" The extension will automatically try alternative methods

🤝 Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest features
  • Submit pull requests

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Made with ❤️ for competitive programmers

About

Solve coding problems effortlessly with AI-powered assistance

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages