-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbrowser-console-check.js
More file actions
94 lines (77 loc) · 2.46 KB
/
browser-console-check.js
File metadata and controls
94 lines (77 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
// Starfleet Gamifier Browser Console Error Check
// Run this script in your browser's DevTools console to check for errors
console.log('🚀 Starting Starfleet Gamifier Browser Console Check...');
// Store original console methods
const originalError = console.error;
const originalWarn = console.warn;
// Track errors and warnings
let errors = [];
let warnings = [];
// Override console methods to capture logs
console.error = function(...args) {
errors.push({
timestamp: new Date().toISOString(),
message: args.join(' '),
stack: new Error().stack
});
originalError.apply(console, args);
};
console.warn = function(...args) {
warnings.push({
timestamp: new Date().toISOString(),
message: args.join(' ')
});
originalWarn.apply(console, args);
};
// Test navigation to all routes
const routes = [
'',
'/actions',
'/missions',
'/leaderboards',
'/admin/organization',
'/admin/users',
'/admin/reports'
];
let currentRouteIndex = 0;
function testNextRoute() {
if (currentRouteIndex >= routes.length) {
showResults();
return;
}
const route = routes[currentRouteIndex];
console.log(`🔍 Testing route: ${route || '/dashboard'}`);
// Navigate to route
window.location.hash = route;
setTimeout(() => {
currentRouteIndex++;
testNextRoute();
}, 2000); // Wait 2 seconds between route changes
}
function showResults() {
console.log('\n📊 BROWSER CONSOLE TEST RESULTS');
console.log('================================');
if (errors.length === 0) {
console.log('✅ No console errors detected!');
} else {
console.log(`❌ Found ${errors.length} console errors:`);
errors.forEach((error, index) => {
console.log(` ${index + 1}. [${error.timestamp}] ${error.message}`);
});
}
if (warnings.length === 0) {
console.log('✅ No console warnings detected!');
} else {
console.log(`⚠️ Found ${warnings.length} console warnings:`);
warnings.forEach((warning, index) => {
console.log(` ${index + 1}. [${warning.timestamp}] ${warning.message}`);
});
}
// Restore original console methods
console.error = originalError;
console.warn = originalWarn;
console.log('\n🏁 Browser console check completed!');
}
// Start the test
console.log('Starting route navigation test in 3 seconds...');
setTimeout(testNextRoute, 3000);