ScreenHawk is a Chrome extension that allows you to capture a screenshot of your active tab, provide context or ask a question about it, and get an analysis from OpenAI's API. The response from OpenAI is then displayed directly on the page.
- Screenshot Capture: Quickly capture a screenshot of the currently active browser tab.
- Area Selection: Select specific areas of the screenshot using an intuitive click-and-drag interface.
- User Input: A prompt allows you to enter text to provide context or ask a specific question related to the captured screenshot.
- OpenAI Integration: Seamlessly sends the screenshot and your query to the OpenAI API for in-depth analysis.
- In-Page Display: Displays the OpenAI API's response directly on the current webpage, making it easy to view and use.
- Keyboard Shortcut: Use
Ctrl+Shift+S(orCmd+Shift+Son Mac) for quick and easy screenshot capture.
- Activate the Extension: Click the ScreenHawk extension icon in your Chrome toolbar or use the keyboard shortcut (
Ctrl+Shift+SorCmd+Shift+S). - Capture Screenshot: The extension will automatically capture a screenshot of your current tab.
- Select Area: Click and drag to select a specific area of the screenshot you want to analyze. You can press Escape to cancel the selection.
- Provide Context/Query: A dialog box will appear. Enter any context or specific questions you have about the selected area.
- Submit for Analysis: Click the "Submit" button.
- View Results: The response from the OpenAI API will be displayed in an overlay on the current page.
To install ScreenHawk for development:
-
Clone the Repository:
git clone <repository-url> cd screenhawk
-
Install Dependencies:
npm install
-
Build the Extension:
npm run build
-
Load Unpacked Extension in Chrome:
- Open Chrome and navigate to
chrome://extensions. - Enable "Developer mode" using the toggle switch in the top right corner.
- Click the "Load unpacked" button.
- Select the
distdirectory from your cloned repository.
- Open Chrome and navigate to
Before using the extension, you need to configure your OpenAI API key:
- Open the file
src/api.tsin your code editor. - Locate the following line:
const OPENAI_API_KEY = '';
- Replace
''with your actual OpenAI API key. - Important: Rebuild the extension (
npm run build) after changing the API key for the changes to take effect.
- TypeScript: For robust and maintainable code.
- Webpack: To bundle the JavaScript, TypeScript, and other assets.
- Chrome Extension APIs: To interact with the Chrome browser, capture tabs, and display content.
- OpenAI API: For image analysis and contextual understanding.
Contributions are welcome! If you have ideas for new features, bug fixes, or improvements, please feel free to:
- Fork the repository.
- Create a new branch for your feature or fix.
- Make your changes.
- Submit a pull request with a clear description of your changes.
This project is currently not licensed. Please refer to the repository for any updates on licensing.