Warning: Puppeteer failed to load. Some features may not work. - Follow Up Deployment
Browse files- index.html +28 -2
index.html
CHANGED
@@ -230,6 +230,20 @@
|
|
230 |
let page;
|
231 |
let currentConversationId;
|
232 |
let lastMessages = {};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
233 |
|
234 |
// LLM Model Configuration
|
235 |
const llmConfig = {
|
@@ -463,6 +477,12 @@
|
|
463 |
|
464 |
// Monitor Instagram DMs in real-time
|
465 |
async function monitorDMs() {
|
|
|
|
|
|
|
|
|
|
|
|
|
466 |
setInterval(async () => {
|
467 |
try {
|
468 |
// Get all conversations
|
@@ -563,10 +583,16 @@
|
|
563 |
|
564 |
try {
|
565 |
// Check if Puppeteer is available
|
566 |
-
if (
|
567 |
-
|
|
|
|
|
|
|
|
|
|
|
568 |
}
|
569 |
|
|
|
570 |
// Launch browser instance
|
571 |
browser = await puppeteer.launch({
|
572 |
headless: false,
|
|
|
230 |
let page;
|
231 |
let currentConversationId;
|
232 |
let lastMessages = {};
|
233 |
+
let puppeteerAvailable = false;
|
234 |
+
|
235 |
+
// Check if Puppeteer loaded properly
|
236 |
+
function checkPuppeteer() {
|
237 |
+
try {
|
238 |
+
if (typeof puppeteer !== 'undefined' && puppeteer.launch) {
|
239 |
+
puppeteerAvailable = true;
|
240 |
+
return true;
|
241 |
+
}
|
242 |
+
return false;
|
243 |
+
} catch (e) {
|
244 |
+
return false;
|
245 |
+
}
|
246 |
+
}
|
247 |
|
248 |
// LLM Model Configuration
|
249 |
const llmConfig = {
|
|
|
477 |
|
478 |
// Monitor Instagram DMs in real-time
|
479 |
async function monitorDMs() {
|
480 |
+
if (!puppeteerAvailable) {
|
481 |
+
// Demo mode - just use sample conversations
|
482 |
+
updateConversationList(conversations);
|
483 |
+
return;
|
484 |
+
}
|
485 |
+
|
486 |
setInterval(async () => {
|
487 |
try {
|
488 |
// Get all conversations
|
|
|
583 |
|
584 |
try {
|
585 |
// Check if Puppeteer is available
|
586 |
+
if (!checkPuppeteer()) {
|
587 |
+
// Fallback to demo mode
|
588 |
+
loginModal.classList.add('hidden');
|
589 |
+
mainApp.classList.remove('hidden');
|
590 |
+
loadMessages(conversations[0].id);
|
591 |
+
alert('Puppeteer not loaded. Running in demo mode with sample conversations.');
|
592 |
+
return;
|
593 |
}
|
594 |
|
595 |
+
puppeteerAvailable = true;
|
596 |
// Launch browser instance
|
597 |
browser = await puppeteer.launch({
|
598 |
headless: false,
|