URL Visit Tracker (Improved)

Track visits per URL, show corner badge history & link hover info - Massive Capacity (10K URLs) - ES2020+ & Smooth Tooltips

目前為 2025-09-06 提交的版本,檢視 最新版本

作者
hongmd
評價
0 0 0
版本
2.5.0
建立日期
2025-09-06
更新日期
2025-09-06
尺寸
36.8 KB
授權條款
MIT
腳本執行於
所有網站

URL Visit Tracker (Improved)

An advanced, production-ready userscript that intelligently tracks your website visits with modern UI/UX and powerful data management capabilities.

🚀 Key Features

📊 Smart Visit Tracking

  • Massive Capacity: Track up to 10,000 URLs with intelligent cleanup
  • Real-time Counter: Live visit count display on every page
  • Visit History: Detailed timestamp records for each visit
  • Auto-cleanup: Smart prioritization keeps important URLs

🎨 Modern User Interface

  • Toggle Badge: Click badge or use menu to hide/show with smooth animations
  • Smooth Tooltips: RequestAnimationFrame-powered movement for 60fps experience
  • Configurable Position: Customize badge placement via CONFIG settings
  • Hover Information: Preview visit count and last visit time on link hover

📈 Advanced Analytics

  • Statistics Dashboard: Total visits, most visited sites, database size
  • Data Export: Download complete visit data as JSON
  • Performance Metrics: Real-time database size monitoring
  • Visit Patterns: Track your browsing habits over time

🎯 How to Use

Initial Setup

  1. Install the script through your userscript manager
  2. Visit any HTTPS website - tracking starts automatically
  3. See the badge appear in bottom-right corner showing visit count

Basic Operations

  • View Statistics: Right-click userscript → "📈 Show Statistics"
  • Export Data: Right-click userscript → "📊 Export Data"
  • Toggle Badge: Click the badge or use "👁️ Toggle Badge" menu
  • Clear Data: Use "🗑️ Clear Current Page" or "💥 Clear All Data"

Advanced Features

  • Hover Preview: Hover over any link to see visit count and last visit time
  • Smart Cleanup: Database automatically maintains optimal size
  • Persistent Settings: Badge visibility state saved across sessions

⚙️ Configuration

Customize the script by editing the CONFIG object:

const CONFIG = {
  MAX_VISITS_STORED: 20,              // History entries per URL
  MAX_URLS_STORED: 10000,             // Maximum URLs tracked
  CLEANUP_THRESHOLD: 12000,           // Auto-cleanup trigger
  HOVER_DELAY: 200,                   // Link hover delay (ms)
  BADGE_POSITION: { 
    right: '14px', 
    bottom: '14px' 
  },                                  // Badge position
  BADGE_VISIBLE: true                 // Initial badge visibility
};

🔧 Technical Features

Performance Optimizations

  • RequestAnimationFrame: Smooth 60fps tooltip movement
  • Debounced Operations: Reduced CPU usage for URL detection
  • Smart Data Structures: Optimized storage and memory usage
  • Intelligent Cleanup: Priority-based URL retention algorithm

Security & Privacy

  • Local Storage Only: All data stays in your browser
  • No Network Requests: Zero external data transmission
  • Safe DOM Operations: XSS-resistant implementation
  • Error Handling: Comprehensive edge case protection

Browser Compatibility

  • Modern Browsers: Chrome, Firefox, Safari, Edge
  • Userscript Managers: Tampermonkey, Violentmonkey, Greasemonkey
  • HTTPS Only: Secure websites only (browser security requirement)

📊 Data Management

Storage Format

{
  "example.com/page": {
    "count": 5,
    "visits": [1693958400000, 1693872000000, ...]
  }
}

Smart Cleanup Algorithm

  • Priority Score: visits × (1 + recency_factor)
  • Retention Logic: Keeps frequently visited + recently accessed URLs
  • Automatic Trigger: Activates when database exceeds threshold
  • Transparent Operation: Console logging for monitoring

🎨 User Interface Guide

Badge Features

  • Click to Toggle: Hide/show badge with smooth scale animation
  • Visit Display: Shows current page visit count with smart formatting
  • Hover Tooltip: Displays detailed visit history with timestamps
  • Position Control: Fully configurable placement

Menu Options

  1. 👁️ Toggle Badge: Show/hide the corner badge
  2. 📊 Export Data: Download complete visit database
  3. 📈 Show Statistics: View comprehensive analytics
  4. 🗑️ Clear Current Page: Reset current page counter to 1
  5. 💥 Clear All Data: Reset entire database (with confirmation)

🔄 Version History

v2.0.1 (Latest)

  • ✅ Enhanced metadata for Greasyfork distribution
  • ✅ Improved license and namespace declarations
  • ✅ Code quality optimizations

v1.9.9

  • ✅ Toggle badge visibility with smooth animations
  • ✅ RequestAnimationFrame tooltip movement
  • ✅ Fixed menu duplication issues
  • ✅ Configurable badge positioning

v1.9.8

  • ✅ Resolved duplicate menu registration
  • ✅ Static menu system for stability
  • ✅ Enhanced error handling

🤝 Credits & Support

Original Concept

Original idea by Chewy - This script builds upon the foundational concept while adding modern features and optimizations.

Support & Issues

Contributing

Contributions are welcome! Please check the GitHub repository for contribution guidelines and development setup.

📄 License

MIT License - Feel free to modify and distribute according to your needs.


⭐ Star the repository if this userscript enhances your browsing experience!