|
43 | 43 | document.body.addEventListener(event, this.logEvent.bind(this)); |
44 | 44 | }); |
45 | 45 |
|
46 | | - console.log('htmx event listeners set up'); |
| 46 | + // console.log('htmx event listeners set up'); |
47 | 47 | } catch (error) { |
48 | 48 | console.error('Error during htmx-debugger initialization:', error); |
49 | 49 | this.handleError(error); |
|
53 | 53 | }, |
54 | 54 |
|
55 | 55 | isExtensionEnvironment: function () { |
56 | | - console.log('Checking extension environment...'); |
| 56 | + // console.log('Checking extension environment...'); |
57 | 57 | if (typeof chrome === 'undefined') { |
58 | 58 | console.warn('Chrome API is not available'); |
59 | 59 | return false; |
|
64 | 64 | } |
65 | 65 | try { |
66 | 66 | chrome.runtime.getURL(''); |
67 | | - console.log('chrome.runtime.id exists:', !!chrome.runtime.id); |
| 67 | + // console.log('chrome.runtime.id exists:', !!chrome.runtime.id); |
68 | 68 | return true; |
69 | 69 | } catch (error) { |
70 | 70 | console.warn('Extension context is invalid:', error.message); |
|
148 | 148 | eventInfo.xhr = this.getXhrInfo(event.detail.xhr); |
149 | 149 | } |
150 | 150 |
|
151 | | - console.log('htmx Event:', eventInfo); |
| 151 | + // console.log('htmx Event:', eventInfo); |
152 | 152 | this.sendMessage(eventInfo); |
153 | 153 | } catch (error) { |
154 | 154 | console.error('Error logging event:', error); |
|
164 | 164 | } |
165 | 165 |
|
166 | 166 | try { |
167 | | - console.log('Sending htmx debug info:', JSON.stringify(data, null, 2)); |
| 167 | + // console.log('Sending htmx debug info:', JSON.stringify(data, null, 2)); |
168 | 168 | chrome.runtime.sendMessage( |
169 | 169 | { |
170 | 170 | type: 'HTMX_EVENT', |
|
177 | 177 | this.isConnected = false; |
178 | 178 | this.attemptReconnection(); |
179 | 179 | } else { |
180 | | - console.log('Message sent successfully:', response); |
| 180 | + // console.log('Message sent successfully:', response); |
181 | 181 | this.reconnectAttempts = 0; // Reset reconnect attempts on successful message |
182 | 182 | } |
183 | 183 | } |
|
310 | 310 | console.warn('Connection check failed, retrying...', chrome.runtime.lastError); |
311 | 311 | setTimeout(checkConnection, 1000); |
312 | 312 | } else { |
313 | | - console.log('Connection verified:', response); |
| 313 | + // console.log('Connection verified:', response); |
314 | 314 | this.isConnected = true; |
315 | 315 | this.reconnectAttempts = 0; |
316 | 316 | resolve(); |
|
333 | 333 |
|
334 | 334 | startConnectionCheck: function () { |
335 | 335 | const periodicCheck = () => { |
336 | | - console.log('Running periodic check...'); |
| 336 | + // console.log('Running periodic check...'); |
337 | 337 | try { |
338 | 338 | if (this.isExtensionEnvironment()) { |
339 | | - console.log('Extension environment valid, verifying connection...'); |
| 339 | + // console.log('Extension environment valid, verifying connection...'); |
340 | 340 | this.verifyConnection() |
341 | 341 | .then(() => { |
342 | | - console.log('Periodic connection check successful'); |
| 342 | + // console.log('Periodic connection check successful'); |
343 | 343 | }) |
344 | 344 | .catch((error) => { |
345 | 345 | console.error('Periodic connection check failed:', error); |
|
353 | 353 | console.error('Error during periodic check:', error); |
354 | 354 | this.handleExtensionInvalidated(); |
355 | 355 | } finally { |
356 | | - console.log('Scheduling next check...'); |
| 356 | + // console.log('Scheduling next check...'); |
357 | 357 | setTimeout(periodicCheck, 5000); |
358 | 358 | } |
359 | 359 | }; |
|
405 | 405 |
|
406 | 406 | // Move the captureHtmxEvent and related functions inside the IIFE |
407 | 407 | function captureHtmxEvent(event) { |
408 | | - console.log('htmx event captured:', event.type, event); |
| 408 | + // console.log('htmx event captured:', event.type, event); |
409 | 409 |
|
410 | 410 | // Skip connection tests and other non-essential events |
411 | 411 | if (event.type === 'TEST' || event.type === 'CONNECTION_TEST' || event.detail?.type === 'CONNECTION_TEST') { |
|
544 | 544 | if (chrome.runtime.lastError) { |
545 | 545 | console.error('Error sending message:', chrome.runtime.lastError); |
546 | 546 | } else { |
547 | | - console.log('Message sent successfully:', response); |
| 547 | + // console.log('Message sent successfully:', response); |
548 | 548 | } |
549 | 549 | } |
550 | 550 | ); |
|
623 | 623 | console.warn('Not running in a Chrome extension environment. htmx event capture disabled.'); |
624 | 624 | } |
625 | 625 | })(); |
626 | | - |
627 | | -console.log('htmx-debugger content script loaded'); |
0 commit comments