Login failed: puppeteer is not defined - Follow Up Deployment
Browse files- index.html +16 -5
index.html
CHANGED
|
@@ -223,7 +223,7 @@
|
|
| 223 |
</div>
|
| 224 |
</div>
|
| 225 |
|
| 226 |
-
<script src="https://cdn.jsdelivr.net/npm/puppeteer
|
| 227 |
<script>
|
| 228 |
// Global variables
|
| 229 |
let browser;
|
|
@@ -562,10 +562,15 @@
|
|
| 562 |
loginBtn.disabled = true;
|
| 563 |
|
| 564 |
try {
|
| 565 |
-
//
|
| 566 |
-
|
| 567 |
-
|
| 568 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 569 |
});
|
| 570 |
|
| 571 |
page = (await browser.pages())[0] || await browser.newPage();
|
|
@@ -611,6 +616,12 @@
|
|
| 611 |
|
| 612 |
// Initialize - show login modal
|
| 613 |
loginModal.classList.remove('hidden');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 614 |
setTimeout(() => {
|
| 615 |
if (conversations.length > 0) {
|
| 616 |
loadMessages(conversations[0].id);
|
|
|
|
| 223 |
</div>
|
| 224 |
</div>
|
| 225 |
|
| 226 |
+
<script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/esm/puppeteer.js"></script>
|
| 227 |
<script>
|
| 228 |
// Global variables
|
| 229 |
let browser;
|
|
|
|
| 562 |
loginBtn.disabled = true;
|
| 563 |
|
| 564 |
try {
|
| 565 |
+
// Check if Puppeteer is available
|
| 566 |
+
if (typeof puppeteer === 'undefined') {
|
| 567 |
+
throw new Error('Puppeteer not loaded. Please check your internet connection.');
|
| 568 |
+
}
|
| 569 |
+
|
| 570 |
+
// Launch browser instance
|
| 571 |
+
browser = await puppeteer.launch({
|
| 572 |
+
headless: false,
|
| 573 |
+
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
| 574 |
});
|
| 575 |
|
| 576 |
page = (await browser.pages())[0] || await browser.newPage();
|
|
|
|
| 616 |
|
| 617 |
// Initialize - show login modal
|
| 618 |
loginModal.classList.remove('hidden');
|
| 619 |
+
|
| 620 |
+
// Check if Puppeteer loaded
|
| 621 |
+
if (typeof puppeteer === 'undefined') {
|
| 622 |
+
alert('Warning: Puppeteer failed to load. Some features may not work.');
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
setTimeout(() => {
|
| 626 |
if (conversations.length > 0) {
|
| 627 |
loadMessages(conversations[0].id);
|