Skip to content

Conversation

@DYAI2025
Copy link

@DYAI2025 DYAI2025 commented Nov 5, 2025

Problem

Due to recent WhatsApp Web updates, the extension could no longer:

  • Access chat text content from messages
  • Reliably detect message reactions
  • Extract messages when DOM structure changed

Solution

Enhanced Message Detection (content.js)

  • Added multiple fallback strategies for finding messages:
    1. Primary: [data-pre-plain-text] selector
    2. Fallback 1: [role="row"] .copyable-text
    3. Fallback 2: .copyable-text[data-id]
    4. Fallback 3: data-id attributes in #main
  • Ensures extension works even when WhatsApp changes selectors

Real Chat Text Extraction

  • Added extractMessageText() method with 5 extraction strategies
  • Looks for .selectable-text elements (primary WhatsApp text container)
  • Falls back to message row parent and sibling elements
  • Extracts and stores actual message text content
  • Now extension has access to real chat data again!

Improved Reaction Detection

  • Enhanced findReactionChipsGeneric() with 2025 selectors
  • Added emoji Unicode range detection (including newer emoji ranges)
  • Searches for small emoji-containing elements (reaction chips)
  • Uses getBoundingClientRect() to filter reaction-sized elements
  • Updated emoji regex to include: 🫠 and other 2025 emojis

Data Storage Updates

  • Added messageText field to all data structures
  • Updated background.js to store and retrieve message text
  • Modified saveToStorage, loadFromStorage, dumpCorpus, importCorpus
  • Message text now available for analytics and export

Version & Logging

  • Bumped version to 2.7 in manifest.json
  • Added informative startup console messages
  • Enhanced debug logging for troubleshooting

Testing Instructions

  1. Load extension in Chrome (chrome://extensions)
  2. Open WhatsApp Web and navigate to a group chat
  3. Open DevTools Console
  4. You should see: "What's That!? v2.7 - Now with enhanced WhatsApp support!"
  5. Scroll through messages - console will show detected messages with text
  6. Run window.showDebugPanel() to see stats
  7. Run window.debugExtension() to verify data extraction

Technical Details

  • Maintains backward compatibility with stored data
  • Non-breaking changes to data structures
  • Graceful fallbacks prevent errors on different WhatsApp versions
  • Performance optimized with try-catch blocks

## Problem
Due to recent WhatsApp Web updates, the extension could no longer:
- Access chat text content from messages
- Reliably detect message reactions
- Extract messages when DOM structure changed

## Solution

### Enhanced Message Detection (content.js)
- Added multiple fallback strategies for finding messages:
  1. Primary: [data-pre-plain-text] selector
  2. Fallback 1: [role="row"] .copyable-text
  3. Fallback 2: .copyable-text[data-id]
  4. Fallback 3: data-id attributes in #main
- Ensures extension works even when WhatsApp changes selectors

### Real Chat Text Extraction
- Added extractMessageText() method with 5 extraction strategies
- Looks for .selectable-text elements (primary WhatsApp text container)
- Falls back to message row parent and sibling elements
- Extracts and stores actual message text content
- Now extension has access to real chat data again!

### Improved Reaction Detection
- Enhanced findReactionChipsGeneric() with 2025 selectors
- Added emoji Unicode range detection (including newer emoji ranges)
- Searches for small emoji-containing elements (reaction chips)
- Uses getBoundingClientRect() to filter reaction-sized elements
- Updated emoji regex to include: 🫠 🫶 🫰 and other 2025 emojis

### Data Storage Updates
- Added messageText field to all data structures
- Updated background.js to store and retrieve message text
- Modified saveToStorage, loadFromStorage, dumpCorpus, importCorpus
- Message text now available for analytics and export

### Version & Logging
- Bumped version to 2.7 in manifest.json
- Added informative startup console messages
- Enhanced debug logging for troubleshooting

## Testing Instructions
1. Load extension in Chrome (chrome://extensions)
2. Open WhatsApp Web and navigate to a group chat
3. Open DevTools Console
4. You should see: "What's That!? v2.7 - Now with enhanced WhatsApp support!"
5. Scroll through messages - console will show detected messages with text
6. Run window.showDebugPanel() to see stats
7. Run window.debugExtension() to verify data extraction

## Technical Details
- Maintains backward compatibility with stored data
- Non-breaking changes to data structures
- Graceful fallbacks prevent errors on different WhatsApp versions
- Performance optimized with try-catch blocks
Copilot AI review requested due to automatic review settings November 5, 2025 17:32
@DYAI2025
Copy link
Author

DYAI2025 commented Nov 5, 2025

It now does work on linux and MacOS on the latest chrome version. It takes a bit on mac until it processes, but works.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants