-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.js
More file actions
74 lines (63 loc) · 2.46 KB
/
debug.js
File metadata and controls
74 lines (63 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// SaveChat Debug Script
// Run this in the browser console on ChatGPT to debug the extension
console.log('=== SaveChat Debug Script ===');
// Check if extension is loaded
console.log('1. Checking if SaveChat extension is loaded...');
if (typeof window.SaveChatDetection !== 'undefined') {
console.log('✅ SaveChat modules are loaded');
} else {
console.log('❌ SaveChat modules are NOT loaded');
}
// Check if instance exists
console.log('2. Checking if SaveChat instance exists...');
if (window.saveChatInstance) {
console.log('✅ SaveChat instance exists');
} else {
console.log('❌ SaveChat instance does not exist');
}
// Check current URL
console.log('3. Current URL:', window.location.href);
// Check for ChatGPT response elements
console.log('4. Looking for ChatGPT response elements...');
const responseSelectors = [
'div[data-message-author-role="assistant"]',
'[data-message-author-role="assistant"]',
'.group.w-full.text-gray-800.dark\\:text-gray-100[data-message-author-role="assistant"]',
'.flex.flex-col.items-center.text-base[data-message-author-role="assistant"]'
];
responseSelectors.forEach(selector => {
const elements = document.querySelectorAll(selector);
console.log(`Selector "${selector}": ${elements.length} elements found`);
if (elements.length > 0) {
console.log('First element:', elements[0]);
}
});
// Check for action trays
console.log('5. Looking for action trays...');
const actionTraySelectors = [
'[data-testid="message-actions"]',
'[data-testid="message-actions-toolbar"]',
'.flex.items-center.justify-end.gap-1',
'.flex.items-center.justify-end.gap-2'
];
actionTraySelectors.forEach(selector => {
const elements = document.querySelectorAll(selector);
console.log(`Action tray selector "${selector}": ${elements.length} elements found`);
if (elements.length > 0) {
console.log('First action tray:', elements[0]);
}
});
// Check for existing save buttons
console.log('6. Checking for existing save buttons...');
const saveButtons = document.querySelectorAll('.savechat-button');
console.log(`Found ${saveButtons.length} existing save buttons`);
// Try to manually trigger the extension
console.log('7. Attempting to manually trigger SaveChat...');
if (window.triggerSaveChat) {
window.triggerSaveChat();
console.log('✅ Manual trigger called');
} else {
console.log('❌ Manual trigger function not available');
}
console.log('=== Debug complete ===');
console.log('Check the console for any error messages above.');