-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdebug-extension.js
More file actions
36 lines (31 loc) · 1.39 KB
/
debug-extension.js
File metadata and controls
36 lines (31 loc) · 1.39 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
// Debug script to check extension status
console.log('=== RoleAlign Extension Debug ===');
// Check if Chrome APIs are available
console.log('Chrome object:', typeof chrome !== 'undefined' ? 'Available' : 'Missing');
console.log('Chrome runtime:', typeof chrome?.runtime !== 'undefined' ? 'Available' : 'Missing');
console.log('Chrome tabs:', typeof chrome?.tabs !== 'undefined' ? 'Available' : 'Missing');
// Check extension ID and status
if (typeof chrome !== 'undefined' && chrome.runtime) {
console.log('Extension ID:', chrome.runtime.id);
console.log('Extension URL:', chrome.runtime.getURL(''));
// Check if background script is responsive
chrome.runtime.sendMessage({type: 'PING'}, (response) => {
if (chrome.runtime.lastError) {
console.error('Background script error:', chrome.runtime.lastError.message);
} else {
console.log('Background script response:', response);
}
});
}
// Check for common extension issues
console.log('Document readyState:', document.readyState);
console.log('Window location:', window.location.href);
// Check for service worker (Manifest V3)
if ('serviceWorker' in navigator) {
navigator.serviceWorker.getRegistrations().then(registrations => {
console.log('Service Worker registrations:', registrations.length);
registrations.forEach((reg, index) => {
console.log(`SW ${index}:`, reg.scope, reg.active?.state);
});
});
}