Skip to content
matejrepkaPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

2 Commits

Folders and files

Repository files navigation

Termily

Termily

A Chrome extension that automatically analyzes Terms of Service and Privacy Policy content to identify potential risks and harmful clauses.

Features

  • ๐Ÿ” Automatically detects Terms of Service and Privacy Policy links on web pages
  • ๐Ÿค– AI-powered analysis using OpenRouter API (optional)
  • ๐Ÿ“Š Risk level assessment (Low, Medium, High)
  • ๐Ÿšจ Identifies red flags and concerning clauses
  • ๐Ÿ’ก Provides recommendations for users
  • ๐ŸŽจ Clean, intuitive popup interface

Setup Instructions

  1. Clone or download this repository
  2. Configure API (optional):
    • Copy config.template.js to config.js
    • Add your OpenRouter API key to config.js
    • If no API key is provided, the extension will use mock analysis
  3. Install the extension:
    • Open Chrome and go to chrome://extensions/
    • Enable "Developer mode" in the top right
    • Click "Load unpacked" and select this extension folder
  4. Start browsing - the extension will automatically analyze pages with Terms of Service content

How It Works

  1. Detection: Content script scans web pages for Terms of Service and Privacy Policy links
  2. Analysis: Background script processes found content using either:
    • OpenRouter API for real AI analysis (if configured)
    • Built-in mock analysis with pattern matching
  3. Results: Popup displays risk assessment, red flags, and recommendations
  4. Badge: Extension badge shows risk level for quick visual reference

Files Structure

  • manifest.json - Extension configuration
  • background.js - Service worker for content processing
  • content.js - Content script for page scanning
  • popup.html/js/css - User interface
  • analyzer.js - Terms analysis logic
  • config.js - API configuration (not tracked in git)
  • icons/ - Extension icons

API Configuration

The extension supports OpenRouter API for enhanced AI analysis:

  1. Sign up at OpenRouter.ai
  2. Get your API key
  3. Add it to config.js

Without an API key, the extension uses built-in pattern matching for basic analysis.

Privacy & Security

  • API keys are stored locally and not transmitted except to the configured API
  • No user data is collected by the extension itself
  • All analysis happens locally or via your configured API

Development

To modify or extend the extension:

  1. Make changes to the source files
  2. Reload the extension in chrome://extensions/
  3. Test on various websites with Terms of Service pages

License

MIT License - see LICENSE file for details

๐Ÿš€ Features

  • Automatic Detection: Scans web pages for Terms of Service and Privacy Policy links
  • Risk Assessment: Analyzes content and provides Low/Medium/High risk ratings
  • Red Flag Identification: Highlights concerning clauses like mandatory arbitration, liability waivers, etc.
  • Clean UI: Modern popup interface with color-coded risk indicators
  • Detailed Analysis: Full breakdown of findings with categorized concerns
  • Export Reports: Save analysis results for future reference
  • Production Ready: Comprehensive error handling and modular architecture

๐Ÿ“ Project Structure

Termily/
โ”œโ”€โ”€ manifest.json          # Extension manifest (Manifest V3)
โ”œโ”€โ”€ background.js          # Service worker for tab monitoring
โ”œโ”€โ”€ content.js            # Content script for page scanning
โ”œโ”€โ”€ analyzer.js           # Mock LLM analysis engine
โ”œโ”€โ”€ popup.html            # Extension popup interface
โ”œโ”€โ”€ popup.js              # Popup JavaScript logic
โ”œโ”€โ”€ popup.css             # Popup styling and themes
โ”œโ”€โ”€ icons/                # Extension icons (16, 32, 48, 128px)
โ”‚   โ””โ”€โ”€ README.md         # Icon creation guidelines
โ””โ”€โ”€ README.md             # This file

๐Ÿ› ๏ธ Installation & Setup

1. Prepare Icons

Create the required icon files in the icons/ directory:

  • icon-16.png (16x16px)
  • icon-32.png (32x32px)
  • icon-48.png (48x48px)
  • icon-128.png (128x128px)

See icons/README.md for design guidelines.

2. Load Extension in Chrome

  1. Open Chrome and navigate to chrome://extensions/
  2. Enable "Developer mode" (toggle in top right)
  3. Click "Load unpacked"
  4. Select the Termily folder
  5. The extension should appear in your extensions list

3. Test the Extension

  1. Visit any website with Terms of Service or Privacy Policy links
  2. Click the Termily extension icon in your toolbar
  3. The extension will automatically scan and analyze the page
  4. View results in the popup interface

๐Ÿ”ง Configuration

API Integration Setup

The extension currently uses mock analysis. To integrate with a real LLM API:

  1. Update analyzer.js:

    const ANALYSIS_CONFIG = {
      API_ENDPOINT: 'https://your-api-endpoint.com/analyze',
      API_KEY: 'YOUR_ACTUAL_API_KEY_HERE'
    };
  2. Implement Real API Call: Replace the analyzeWithRealAPI() function in analyzer.js with your actual API integration.

  3. Update Background Script: Modify background.js to use real API instead of mock analysis.

Extension Settings

Currently uses hardcoded configuration. Future versions will include:

  • API endpoint configuration
  • Risk threshold customization
  • Analysis sensitivity settings
  • Custom keyword patterns

๐Ÿ“Š How It Works

1. Page Scanning

  • Content script runs on all web pages
  • Searches for Terms/Privacy Policy links using keyword detection
  • Extracts text content when possible

2. Content Analysis

  • Sends extracted content to analyzer module
  • Mock analysis simulates LLM processing
  • Identifies risk patterns and concerning clauses
  • Calculates overall risk score

3. Result Display

  • Background script stores analysis results
  • Popup displays color-coded risk assessment
  • Shows key concerns and recommendations
  • Provides detailed analysis modal

4. Risk Assessment Levels

  • ๐ŸŸข LOW RISK (0-19 points): Standard terms with minimal user risk
  • ๐ŸŸก MEDIUM RISK (20-49 points): Some concerning clauses present
  • ๐Ÿ”ด HIGH RISK (50+ points): Multiple harmful terms that favor company

๐Ÿ” Analysis Features

Risk Factors Detected

  • Mandatory arbitration clauses
  • Class action waivers
  • Unlimited liability terms
  • No-notice termination rights
  • Personal data selling permissions
  • Content licensing overreach
  • Liability limitations

Content Categories

  • Legal Terms: Arbitration, governing law, dispute resolution
  • Privacy & Data: Collection, sharing, third-party access
  • Liability & Risk: User indemnification, company protections
  • Termination: Account suspension, service discontinuation

๐ŸŽจ UI/UX Features

Popup Interface

  • Clean, modern design with gradients
  • Color-coded risk indicators (green/yellow/red)
  • Expandable detailed analysis
  • One-click report sharing
  • Accessibility support (keyboard navigation, high contrast)

Visual Indicators

  • Extension badge shows risk level
  • Animated loading states
  • Toast notifications
  • Modal overlays for detailed views

๐Ÿ” Privacy & Permissions

Required Permissions

  • activeTab: Access current tab for content analysis
  • scripting: Inject content scripts for page scanning
  • storage: Cache analysis results locally

Data Handling

  • No personal data collection
  • Analysis results stored locally only
  • No tracking or analytics
  • Content sent to API only for analysis (configurable)

๐Ÿšจ Error Handling

Comprehensive Error Management

  • Network failure recovery
  • Invalid content handling
  • API timeout management
  • Extension context errors
  • User-friendly error messages

Logging & Debugging

  • Console logging for development
  • Error state display in UI
  • Retry mechanisms for failed operations
  • Graceful degradation

๐Ÿ”„ Development Workflow

Testing

  1. Load extension in development mode
  2. Visit various websites with terms pages
  3. Check console for errors/warnings
  4. Test popup functionality and UI states
  5. Verify analysis accuracy

Debugging

  • Use Chrome DevTools for content script debugging
  • Check extension service worker console
  • Monitor network requests for API calls
  • Test error scenarios and edge cases

๐Ÿš€ Deployment

Chrome Web Store Preparation

  1. Create proper extension icons
  2. Configure real API integration
  3. Test thoroughly across websites
  4. Create store listing assets
  5. Submit for review

Production Checklist

  • Replace mock analysis with real API
  • Add proper error reporting
  • Implement user settings
  • Create help documentation
  • Set up feedback collection
  • Add usage analytics (optional)

๐Ÿ”ฎ Future Enhancements

Planned Features

  • Real-time analysis with streaming results
  • Custom risk threshold configuration
  • Terms comparison between services
  • Historical analysis tracking
  • Browser sync for analysis results
  • Multilingual support
  • Corporate/enterprise features

API Integrations

  • OpenAI GPT-4 for analysis
  • Anthropic Claude for legal interpretation
  • Custom legal AI models
  • Terms database integration

๐Ÿค Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/amazing-feature)
  3. Commit changes (git commit -m 'Add amazing feature')
  4. Push to branch (git push origin feature/amazing-feature)
  5. Open Pull Request

๐Ÿ“„ License

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

๐Ÿ†˜ Support

  • Issues: Report bugs on GitHub Issues
  • Feature Requests: Open enhancement requests
  • Documentation: Check wiki for additional help
  • Contact: Email support for urgent matters

๐Ÿ™ Acknowledgments

  • Inspired by privacy advocacy tools
  • Built with Chrome Extensions Manifest V3
  • Uses modern web technologies
  • Community feedback and contributions

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages