Commit Graph

15 Commits

Author SHA1 Message Date
renato97
cba176dab9 Add error handling to debug button
Added:
- Console log when button is clicked
- Console log showing button element
- Try-catch wrapper around the function
- Error logging with stack trace

This will show if the button click is detected and where it fails!
2025-11-04 05:41:25 +00:00
renato97
8f15cb8001 Add debug button to detect page counts
New button added:
- 🔍 Debug: Contar Páginas (purple button)
- Scans ALL manga on the page
- Fetches each manga's gallery page
- Detects page count using the same logic
- Shows detailed results in console
- Lists: Title, URL, and detected page count

Usage:
1. Click the purple 'Debug: Contar Páginas' button
2. Check console for detailed results
3. Share the console output

This will show exactly what page counts are being detected!
2025-11-04 05:38:35 +00:00
renato97
8cc0ba5534 Add detailed page detection logging
Now logs:
- Every div that matches 'X pages' pattern
- The text content of each match
- The page count found
- The div's className and ID
- Whether it was ACCEPTED or REJECTED
- All potential matches in an array
- Why counts are rejected (out of range)

This will show us exactly what's being detected as 213, 28, and 2832 pages!
2025-11-04 05:34:17 +00:00
renato97
acaea82b77 Fix page detection and download loop issues
Fixed:
1. Page detection now looks for exact 'X pages' pattern in divs
2. Validates page count is reasonable (1-100)
3. Download loop continues even if one manga fails
4. Added comprehensive error handling and logging
5. Logs background responses to verify downloads
2025-11-04 05:29:05 +00:00
renato97
1b1ab08808 Add comprehensive button click debugging
🔍 Now logs:
- Button click events
- Function execution
- selectedMangas Set contents and size
- mangaMetadata Map size
- Each metadata lookup
- Final selectedObjects array
- Button element existence check

This will show us exactly where the chain is breaking!
2025-11-04 05:24:30 +00:00
renato97
fafa2f0c05 Implement download logic in content script
 Now works without popup:
- downloadSelectedMangas() downloads selected manga
- downloadAllMangas() downloads all manga from page
- Progress updates in control panel
- Download happens directly in content script
- No need to keep popup open
- Buttons in control panel now work!

Features:
- Real-time progress bar
- Live status updates
- Automatic completion handling
- Error logging for failed downloads
- Returns to control panel after completion
2025-11-04 05:22:03 +00:00
renato97
771b001923 Fix selected count updating in control panel
 Fixed:
- updateSelectedCount() now updates control panel directly
- Count now shows real-time updates when checking/unchecking manga
- Added console logging to track count updates
- Also maintains compatibility with popup.js

The control panel should now show correct selected count!
2025-11-04 05:19:57 +00:00
renato97
54563424b4 Auto-create control panel on page load
 Fixed:
- Control panel now created automatically when page loads
- No need to wait for messages
- Creates alongside checkboxes and Select All button
- Will appear in top-right corner 1 second after page load

The control panel should now be visible immediately!
2025-11-04 05:18:00 +00:00
renato97
3d7b1e74d6 Transform popup into top-right control panel
 New Features:
- Popup now positioned in top-right corner (not center)
- Permanent floating control panel with 3 buttons
- Control panel shows selected count
- Buttons: Download Selected, Download ALL, Clear Selection
- Clicking buttons triggers downloads from within the page
- Progress panel appears OVER control panel during downloads
- After download completes, returns to control panel

🎯 User Experience:
- No need to open extension popup anymore
- All controls directly on the page
- Real-time progress tracking
- Cleaner workflow

📱 UI:
- Purple gradient design
- Responsive button layout
- Progress bar with percentage
- Auto-hide progress, show controls
2025-11-04 05:16:08 +00:00
renato97
809d290a8a Add message listener logging
🔍 Now logs ALL messages received from popup.js:
- Logs when any message is received (with action type)
- Logs showProgress messages specifically
- Logs getSelectedMangas requests
- Logs getImageUrls requests
- Logs extractAllMangas requests
- Logs hideProgress requests

This will tell us if popup.js is actually sending messages to content script
2025-11-04 05:08:49 +00:00
renato97
951fc56be8 Add comprehensive debugging to popup
🔍 Debug logging added:
- Log every updateProgress() call with parameters
- Check if popup exists before updating
- Log percentage calculations
- Verify all DOM elements are found
- Log each element update (title, count, percent, status, bar)
- Force popup visibility with display: block and opacity: 1
- Log popup position on screen

This will help identify exactly where the popup is failing
2025-11-04 05:07:39 +00:00
renato97
9068abfe9c Fix floating progress popup display
🎨 Popup improvements:
- Changed to inline styles (no cssText) for better compatibility
- Set display: block by default (always visible)
- Increased z-index to 999999 (maximum priority)
- Better styling with backdrop filter
- Added comprehensive console logging for debugging
- Popup now shows immediately when created

Debugging:
- Added logs for popup creation, DOM insertion, and element access
- Better error tracking for popup visibility issues
2025-11-04 05:06:43 +00:00
renato97
121210ca84 Fix page detection and add floating progress popup
 Improvements:
- Enhanced page detection to support 'X pages' pattern
- Added comprehensive logging for debugging
- Implemented floating progress popup on page
- Added show/hide progress message handlers
- Better error handling and logging for image extraction
- Fixed popup to display real-time progress

🐛 Fixed:
- Page detection now works for both 'Showing X of Y images' and 'X pages' patterns
- Downloads should now work correctly with proper page iteration
- Added visible feedback via floating popup

🔍 Debugging:
- Added console logs for page detection
- Logs show total pages found and images extracted
- Each page is logged during processing
2025-11-04 05:05:10 +00:00
renato97
aa45241525 Fix metadata storage for selected manga
- Added mangaMetadata Map to store full manga objects with title, token, url, baseUrl
- Modified getSelectedMangas to return full manga objects instead of just IDs
- Fixed substring error when downloading selected manga
- Enhanced checkbox creation to save metadata during initialization
- Improved logging for selection/deselection events

Resolves: Error: Cannot read properties of undefined (reading 'substring')
2025-11-04 04:32:16 +00:00
renato97
829996b41e Initial commit: Manga Mass Downloader Chrome Extension
 Features:
- Multi-selection checkboxes on manga listings
- Batch download selected manga or all manga from page
- Optimized parallel downloading (20ms delays, 5 concurrent)
- Visual progress tracking
- Popup UI for easy control
- Fixed duplicate checkbox issue with deduplication logic

📁 Files:
- manifest.json: Extension configuration
- content.js: Checkbox injection & manga detection
- background.js: Optimized download engine
- popup.html/js: User interface
- README.md: Complete documentation
2025-11-04 04:25:25 +00:00