Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 10b77e2

Browse files
committed
comment out console logs
1 parent 6944827 commit 10b77e2

File tree

8 files changed

+20
-24
lines changed

8 files changed

+20
-24
lines changed

‎src/background/background.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
152152
isViewChange ? 'View Changed' :
153153
isActualRefresh ? 'Page Refresh' :
154154
'Page Load';
155-
console.log(`State change detected - ${changeType}`);
155+
//console.log(`State change detected - ${changeType}`);
156156

157157
// Update last state
158158
lastState.problemPath = problemPath;

‎src/content-script/get-user-code.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function getProblem() {
7070
// Get test cases, output, and expected output
7171
const consoleData = getConsoleData();
7272
if (consoleData.length > 0) {
73-
console.log('Console Data:', consoleData);
73+
//console.log('Console Data:', consoleData);
7474
collectedData.push("\n--- Test Cases and Results ---\n" + consoleData.join('\n'));
7575
}
7676

‎src/content-script/themeDetector.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ function isColorDark(color) {
8282
// Extract RGB values
8383
const rgb = color.match(/\d+/g);
8484
if (!rgb || rgb.length < 3) {
85-
console.log('Could not extract RGB values from color:', color);
8685
return true; // Default to dark if can't extract
8786
}
8887

@@ -93,7 +92,6 @@ function isColorDark(color) {
9392

9493
// Weighted luminance formula (human eye is more sensitive to green)
9594
const luminance = 0.2126 * r + 0.7152 * g + 0.0722 * b;
96-
console.log(`Color luminance: ${luminance} (< 0.5 is dark)`);
9795

9896
// Return true for dark colors (lower luminance)
9997
return luminance < 0.5;

‎src/content-script/update-description-tab.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function detectAndSyncTheme() {
4545
isDarkTheme: leetcodeTheme === 'dark'
4646
});
4747

48-
console.log(`Theme auto-detected: ${leetcodeTheme}`);
48+
//console.log(`Theme auto-detected: ${leetcodeTheme}`);
4949

5050
// Set up observer for future theme changes
5151
observeThemeChanges();
@@ -70,7 +70,7 @@ function observeThemeChanges() {
7070
chrome.storage.local.set({
7171
isDarkTheme: leetcodeTheme === 'dark'
7272
});
73-
console.log(`Theme changed to: ${leetcodeTheme}`);
73+
//console.log(`Theme changed to: ${leetcodeTheme}`);
7474
}
7575
});
7676
});
@@ -215,7 +215,7 @@ function showCompanyTags(problemTitle: string) {
215215
}
216216

217217
if (!description) {
218-
console.log('Failed to find description element after all retries');
218+
//console.log('Failed to find description element after all retries');
219219

220220
// If still not found, set up a MutationObserver to watch for DOM changes
221221
const observer = new MutationObserver((mutations, obs) => {
@@ -375,7 +375,7 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
375375
if (request.action === 'updateDescription') {
376376
// Only detect theme on first load, problem change, or refresh
377377
if (!request.isProblemChange && !request.isRefresh) {
378-
console.log('Skipping theme detection for internal navigation');
378+
//console.log('Skipping theme detection for internal navigation');
379379
return;
380380
}
381381

‎src/content-script/update-solutions-tab.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ function updateSolutionsTab(title: string) {
673673

674674
// If it's the same problem and the wrapper is in the DOM, preserve state
675675
if (wrapperTitle === currentTitle && document.contains(existingWrapper)) {
676-
console.log('Content exists for current problem, preserving state');
676+
//console.log('Content exists for current problem, preserving state');
677677
return;
678678
}
679679

@@ -694,13 +694,13 @@ function updateSolutionsTab(title: string) {
694694
// Use exponential backoff for retry delay
695695
const delay = baseDelay * Math.pow(1.5, retryCount);
696696
retryCount++;
697-
console.log(`Attempt ${retryCount}: Waiting for search bar element to load... Retrying in ${delay}ms`);
697+
//console.log(`Attempt ${retryCount}: Waiting for search bar element to load... Retrying in ${delay}ms`);
698698
setTimeout(tryInsertContent, delay);
699699
return;
700700
}
701701

702702
if (!searchBar) {
703-
console.log('Failed to find search bar element after all retries');
703+
//console.log('Failed to find search bar element after all retries');
704704

705705
// If still not found, set up a MutationObserver to watch for DOM changes
706706
const observer = new MutationObserver((mutations, obs) => {

‎src/popup/popup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ function initActionButton(buttonId: string, action: 'analyze' | 'fix', aiProvide
7777
actionButton.onclick = async () => {
7878
const codeText = await getCodeFromActiveTab();
7979
if (codeText) {
80-
console.log(codeText);
80+
//console.log(codeText);
8181
processCode(aiProvider, codeText, action);
8282
} else {
8383
const errorMessage = "Cannot read from page. Please open a Leetcode problem and refresh the page.";

‎src/popup/settings.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ document.addEventListener('DOMContentLoaded', () => {
2828

2929
// Helper function to send messages safely to content script
3030
function safelySendMessage(message) {
31-
console.log('Sending message to content script:', message);
31+
//console.log('Sending message to content script:', message);
3232
chrome.tabs.query({active: true, currentWindow: true}, (tabs) => {
3333
if (!tabs || !tabs[0] || !tabs[0].id) {
34-
console.log('No active tab found');
34+
//console.log('No active tab found');
3535
return;
3636
}
3737

@@ -51,9 +51,7 @@ document.addEventListener('DOMContentLoaded', () => {
5151
}).catch(err => {
5252
console.log('Error injecting content script:', err);
5353
});
54-
} else {
55-
console.log('Message sent successfully, response:', response);
56-
}
54+
}
5755
});
5856
} catch (error) {
5957
console.log('Error sending message:', error);

‎src/utils/theme.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ const THEME_STYLES = {
5656

5757
// Initialize theme on load
5858
export function initializeTheme(): void {
59-
console.log('Initializing theme...');
59+
//console.log('Initializing theme...');
6060

6161
// Get saved theme settings
6262
chrome.storage.local.get(['isDarkTheme', 'themeMode', 'lastDetectedTheme'], (result) => {
6363
let theme: ThemeName = result.isDarkTheme ? 'dark' : 'light';
6464
const mode: ThemeMode = result.themeMode === 'auto' ? 'auto' : 'manual';
6565

66-
console.log(`Theme settings: Theme=${theme}, Mode=${mode}`);
66+
//console.log(`Theme settings: Theme=${theme}, Mode=${mode}`);
6767

6868
// For auto mode, use last detected theme if available
6969
if (mode === 'auto' && result.lastDetectedTheme) {
@@ -82,7 +82,7 @@ export function initializeTheme(): void {
8282

8383
// Set theme based on dropdown selection
8484
export function setTheme(theme: ThemeName | 'auto'): void {
85-
console.log(`Setting theme to: ${theme}`);
85+
//console.log(`Setting theme to: ${theme}`);
8686

8787
if (theme === 'auto') {
8888
// Enable auto mode but keep current theme until detection
@@ -103,7 +103,7 @@ export function setTheme(theme: ThemeName | 'auto'): void {
103103

104104
// Apply a theme to the current page
105105
function applyTheme(theme: ThemeName, mode: ThemeMode): void {
106-
console.log(`Applying theme: ${theme}, mode: ${mode}`);
106+
//console.log(`Applying theme: ${theme}, mode: ${mode}`);
107107

108108
// Set data attribute for CSS variables
109109
document.documentElement.setAttribute('data-theme', theme);
@@ -174,7 +174,7 @@ function updateThemeUI(theme: ThemeName, mode: ThemeMode): void {
174174

175175
// Detect theme from active LeetCode page
176176
function detectThemeFromPage(): void {
177-
console.log('Detecting theme from active tab...');
177+
//console.log('Detecting theme from active tab...');
178178

179179
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
180180
if (tabs[0]?.id) {
@@ -183,12 +183,12 @@ function detectThemeFromPage(): void {
183183
{ action: 'getTheme' },
184184
(response) => {
185185
if (chrome.runtime.lastError) {
186-
console.log('Error detecting theme:', chrome.runtime.lastError);
186+
//console.log('Error detecting theme:', chrome.runtime.lastError);
187187
return;
188188
}
189189

190190
if (response?.theme) {
191-
console.log('Detected theme:', response.theme);
191+
//console.log('Detected theme:', response.theme);
192192

193193
// Apply the detected theme
194194
applyTheme(response.theme, 'auto');

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /