Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

JKevinXu/ChatBrowse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

91 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🌐 ChatBrowse - Intelligent Web Automation Extension

ChatBrowse is a powerful Chrome extension that transforms web browsing through AI-powered natural language commands. Navigate, search, and interact with websites using intelligent automation and conversational interfaces.

Chrome Extension TypeScript OpenAI Webpack

✨ Key Features

πŸ€– Intelligent Action System

  • Natural Language Processing: Execute commands like "find videos about Python programming"
  • Smart Platform Detection: Automatically detects YouTube, Google, Amazon, and other platforms
  • Two-Step Execution: AI plans actions, then executes on your command
  • Cross-Platform Search: Works seamlessly across different websites

πŸ’¬ Advanced Chat Interface

  • Persistent Sessions: Chat history saved per website
  • Context-Aware Responses: AI understands page content and user intent
  • Real-time Interaction: Instant feedback and action execution
  • Error Recovery: Intelligent fallback mechanisms

πŸ”§ Modern Architecture

  • Service-Based Design: Modular, maintainable codebase
  • TypeScript: Full type safety and IntelliSense support
  • Production-Ready: Optimized builds with tree shaking
  • Developer-Friendly: Source maps and debugging tools

πŸš€ Quick Start

Prerequisites

  • Chrome Browser (latest version recommended)
  • Node.js v14+ and npm v6+
  • OpenAI API Key (Get one here)

Installation

  1. Clone & Setup

    git clone https://github.com/JKevinXu/ChatBrowse.git
    cd ChatBrowse
    npm install
  2. Build the Extension

    npm run build
  3. Load in Chrome

    • Open chrome://extensions/
    • Enable "Developer mode" (top-right toggle)
    • Click "Load unpacked" β†’ Select the dist/ folder
    • Pin the ChatBrowse icon to your toolbar
  4. Configure API Key

    • Click the ChatBrowse icon
    • Click the settings gear βš™οΈ
    • Enter your OpenAI API key
    • Save settings

🎯 Usage Examples

Smart Search Commands

"find videos about machine learning"     β†’ Searches YouTube
"search for wireless headphones"        β†’ Searches Amazon  
"look for news about climate change"    β†’ Searches Google

Navigation Commands

"go to youtube.com"                      β†’ Navigates to URL
"navigate to the homepage"              β†’ Smart navigation

Content Commands

"extract info from this page"           β†’ Summarizes content
"set context on"                        β†’ Enables page context

Action Execution

  1. Request: Type your command (e.g., "find cooking videos")
  2. Plan: AI shows what it will do (90% confidence)
  3. Execute: Say "do it" to run the actions
  4. Result: Actions execute automatically with feedback

πŸ—οΈ Architecture

Service-Based Design

πŸ“ src/
β”œβ”€β”€ πŸ”§ services/           # Core business logic
β”‚   β”œβ”€β”€ action-service.ts    # Action planning & execution
β”‚   β”œβ”€β”€ openai-service.ts    # AI integration
β”‚   β”œβ”€β”€ search-service.ts    # Multi-platform search
β”‚   β”œβ”€β”€ message-router.ts    # Message handling
β”‚   β”œβ”€β”€ navigation-service.ts # Navigation logic
β”‚   β”œβ”€β”€ context-service.ts   # Page context management
β”‚   └── config-service.ts    # Settings & configuration
β”œβ”€β”€ πŸ“± popup/             # Extension popup UI
β”‚   β”œβ”€β”€ popup-ui.ts         # DOM manipulation
β”‚   β”œβ”€β”€ session-manager.ts  # Session persistence
β”‚   └── message-handler.ts  # Background communication
β”œβ”€β”€ 🌐 content/           # Content script services
β”‚   β”œβ”€β”€ action-executor.ts  # Page automation
β”‚   β”œβ”€β”€ page-analyzer.ts    # Page structure analysis
β”‚   └── chat-ui.ts         # Chat interface
β”œβ”€β”€ πŸ› οΈ utils/             # Utility modules
β”‚   β”œβ”€β”€ content-extractor.ts # Page content extraction
β”‚   β”œβ”€β”€ command-processor.ts # Command parsing
β”‚   └── storage-utils.ts    # Chrome storage operations
β”œβ”€β”€ background.ts         # Service worker
β”œβ”€β”€ content.ts           # Content script entry
β”œβ”€β”€ popup.ts            # Popup entry
└── types.ts           # TypeScript definitions

Build System

  • Production Build: npm run build (143 KiB, optimized)
  • Development Build: npm run build:dev (199 KiB, debug enabled)
  • Watch Mode: npm run watch (auto-rebuild on changes)

πŸ”§ Development

Build Commands

npm run build      # Production build (optimized, no console.log)
npm run build:dev  # Development build (source maps, debug)
npm run watch      # Watch mode for development

Environment Configuration

  • Production: Minified, console.log removed, debug excluded
  • Development: Source maps, debug tools, full logging

Architecture Benefits

  • βœ… Single Responsibility Principle: Each service has one clear purpose
  • βœ… Dependency Injection: Services can be easily mocked and tested
  • βœ… Type Safety: Full TypeScript coverage with strict mode
  • βœ… Error Handling: Consistent error handling across all services
  • βœ… Modularity: Easy to extend and maintain

πŸŽ›οΈ Configuration

OpenAI Settings

  • API Key: Required for AI functionality
  • Model: GPT-3.5-turbo (configurable)
  • Context: Automatic page content inclusion

Extension Settings

  • Notifications: Enable/disable system notifications
  • Theme: Light/dark mode support
  • Language: Multi-language support (planned)

🀝 Contributing

We welcome contributions! The codebase is designed for easy extension and modification.

Development Setup

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Install dependencies: npm install
  4. Start watch mode: npm run watch
  5. Make your changes
  6. Test with npm run build:dev
  7. Submit a Pull Request

Code Standards

  • TypeScript: Strict mode enabled
  • Services: Follow the existing service pattern
  • Error Handling: Use consistent error handling patterns
  • Testing: Add tests for new functionality (planned)

πŸ“¦ Bundle Size

Script Production Development
Background 118 KiB 158 KiB
Content 18.4 KiB 22 KiB
Popup 5.44 KiB 10.3 KiB
Total 143 KiB 199 KiB

πŸ› Troubleshooting

Common Issues

  • No response from AI: Check OpenAI API key in settings
  • Actions not executing: Refresh page and try again
  • Search not working: Ensure you're on a supported platform

Debug Mode

Use development build (npm run build:dev) for detailed console logging and debugging tools.

πŸ“„ License

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

πŸ”— Links


Made with ❀️ by JKevinXu

Transform your browsing experience with intelligent automation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published