╔════════════════════════════════════════════════════════════════╗
║                     BROWSER TAB INFORMATION                     ║
║                                                                  ║
║                  Self-Hosted WhatsApp Server                    ║
╚════════════════════════════════════════════════════════════════╝


QUESTION: Do I need to keep the browser tabs open after connecting?
──────────────────────────────────────────────────────────────────────

SHORT ANSWER:
✅ YES - Keep the main WhatsApp Web window open
❌ NO - The QR code tab will auto-close (you don't need it)


DETAILED EXPLANATION:
──────────────────────────────────────────────────────────────────────

When you run the server, TWO browser windows/tabs will open:

1️⃣  WHATSAPP WEB TAB (https://web.whatsapp.com/)
    ├─ This opens AUTOMATICALLY when server starts
    ├─ Shows WhatsApp Web interface
    ├─ ⚠️  MUST STAY OPEN while sending messages
    └─ This is where the actual WhatsApp connection lives


2️⃣  QR CODE TAB (http://localhost:3000/qr)
    ├─ Shows the QR code for scanning
    ├─ Automatically CLOSES after successful scan (3 seconds)
    └─ ✅ You don't need to keep this open


WHY MUST THE WHATSAPP WEB TAB STAY OPEN?
──────────────────────────────────────────────────────────────────────

The self-hosted server uses "whatsapp-web.js" which is basically an
automated browser (Puppeteer/Chrome) that controls WhatsApp Web.

Think of it like this:
  • Your server = Robot controlling a browser
  • The browser = WhatsApp Web (needs to stay open)
  • Your app (app.php) = Sends commands to the robot

If you close the WhatsApp Web browser window:
  ❌ Connection will be lost
  ❌ Messages won't send
  ❌ You'll need to reconnect and scan QR again


WHAT SHOULD I DO?
──────────────────────────────────────────────────────────────────────

AFTER SCANNING QR CODE:

1. ✅ The QR code tab will auto-close - this is normal

2. ✅ MINIMIZE (don't close) the WhatsApp Web browser window

3. ✅ Go back to your main app (app.php) and start sending messages

4. ✅ Let the WhatsApp Web window run in the background


CAN I MINIMIZE THE WHATSAPP WEB WINDOW?
──────────────────────────────────────────────────────────────────────

✅ YES! You can MINIMIZE it to the taskbar
❌ NO! You cannot CLOSE it completely


TIPS FOR KEEPING IT RUNNING:
──────────────────────────────────────────────────────────────────────

💡 Best Practice: Just minimize the Chrome window with WhatsApp Web

💡 For Long-term Use: The window must stay open as long as you want
   to send messages through your app

💡 If You Accidentally Close It:
   - Stop the server (Ctrl+C in terminal)
   - Run the server again
   - Scan QR code again
   - Connection restored!


SUMMARY:
──────────────────────────────────────────────────────────────────────

WINDOW                      KEEP OPEN?    WHAT TO DO?
──────────────────────────────────────────────────────────────────────
QR Code Tab                 ❌ No          Auto-closes after scan
(localhost:3000/qr)

WhatsApp Web Window         ✅ Yes         Minimize it, don't close
(web.whatsapp.com)

Your App                    ⭐ Active      Use this to send messages
(app.php)


┌────────────────────────────────────────────────────────────────┐
│  💡 PRO TIP: Think of the WhatsApp Web window as your         │
│     "connection" to WhatsApp. As long as it's running,        │
│     your app can send messages through it!                    │
└────────────────────────────────────────────────────────────────┘


═══════════════════════════════════════════════════════════════════
                       COMMON QUESTIONS
═══════════════════════════════════════════════════════════════════

Q: Can I use my phone while the server is running?
A: Yes! Once connected, you can use WhatsApp normally on your phone.

Q: Will messages show up in my phone's chat history?
A: Yes! All sent messages appear in your WhatsApp as if you sent them.

Q: What if I restart my computer?
A: You'll need to scan the QR code again when you restart the server.

Q: Can I close the terminal window?
A: No, that will stop the server. Minimize it instead.

Q: The WhatsApp Web window logged out by itself?
A: This can happen. Just restart the server and scan QR again.


═══════════════════════════════════════════════════════════════════
                    TROUBLESHOOTING
═══════════════════════════════════════════════════════════════════

PROBLEM: Messages not sending
SOLUTION: Check if WhatsApp Web window is still open and logged in

PROBLEM: Connection lost
SOLUTION: Make sure you didn't close the WhatsApp Web browser window

PROBLEM: Chrome keeps closing
SOLUTION: The server might have crashed. Check the terminal for errors

PROBLEM: QR code keeps showing up
SOLUTION: Make sure you're scanning it completely with your phone


═══════════════════════════════════════════════════════════════════

For more help, see: QUICK-START.md or README.txt
