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 36c514e

Browse files
committed
rm console logs
1 parent 921ce7e commit 36c514e

File tree

7 files changed

+7
-29
lines changed

7 files changed

+7
-29
lines changed

‎src/background/background.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ chrome.runtime.onInstalled.addListener(() => {
2525
chrome.storage.local.set({ leetcodeProblems: data });
2626
})
2727
.catch((error) => {
28-
console.error(error);
28+
console.error('Failed to load problem data:',error);
2929
});
3030

3131
// Load problems by company JSON file into storage
@@ -36,7 +36,7 @@ chrome.runtime.onInstalled.addListener(() => {
3636
chrome.storage.local.set({ companyProblems: data });
3737
})
3838
.catch((error) => {
39-
console.error(error);
39+
console.error('Failed to load company problems:',error);
4040
});
4141

4242
// Load default settings
@@ -152,7 +152,6 @@ 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}`);
156155

157156
// Update last state
158157
lastState.problemPath = problemPath;

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,11 @@ function showCompanyTags(problemTitle: string) {
209209
// Use exponential backoff for retry delay
210210
const delay = baseDelay * Math.pow(1.5, retryCount);
211211
retryCount++;
212-
//console.log(`Attempt ${retryCount}: Waiting for description element to load... Retrying in ${delay}ms`);
213212
setTimeout(tryInsertCompanyTags, delay);
214213
return;
215214
}
216215

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

220218
// If still not found, set up a MutationObserver to watch for DOM changes
221219
const observer = new MutationObserver((mutations, obs) => {
@@ -375,7 +373,6 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
375373
if (request.action === 'updateDescription') {
376374
// Only detect theme on first load, problem change, or refresh
377375
if (!request.isProblemChange && !request.isRefresh) {
378-
//console.log('Skipping theme detection for internal navigation');
379376
return;
380377
}
381378

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

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,6 @@ 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');
677676
return;
678677
}
679678

@@ -694,13 +693,11 @@ function updateSolutionsTab(title: string) {
694693
// Use exponential backoff for retry delay
695694
const delay = baseDelay * Math.pow(1.5, retryCount);
696695
retryCount++;
697-
//console.log(`Attempt ${retryCount}: Waiting for search bar element to load... Retrying in ${delay}ms`);
698696
setTimeout(tryInsertContent, delay);
699697
return;
700698
}
701699

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

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

‎src/popup/popup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ async function main(): Promise<void> {
293293
elements['getComplexityBtn']?.classList.remove('hidden');
294294
elements['fixCodeBtn']?.classList.remove('hidden');
295295
} catch (error) {
296-
console.log(error);
296+
console.error('Failed to initialize popup:',error);
297297
}
298298
}
299299

‎src/popup/settings.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,15 @@ 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);
3231
chrome.tabs.query({active: true, currentWindow: true}, (tabs) => {
3332
if (!tabs || !tabs[0] || !tabs[0].id) {
34-
//console.log('No active tab found');
3533
return;
3634
}
3735

3836
try {
3937
chrome.tabs.sendMessage(tabs[0].id, message, response => {
4038
if (chrome.runtime.lastError) {
41-
console.log('Error sending message:', chrome.runtime.lastError.message);
39+
console.error('Error sending message:', chrome.runtime.lastError.message);
4240
// Attempt to inject the content script if it's not already injected
4341
chrome.scripting.executeScript({
4442
target: { tabId: tabs[0].id },
@@ -49,12 +47,12 @@ document.addEventListener('DOMContentLoaded', () => {
4947
chrome.tabs.sendMessage(tabs[0].id, message);
5048
}, 100);
5149
}).catch(err => {
52-
console.log('Error injecting content script:', err);
50+
console.error('Error injecting content script:', err);
5351
});
5452
}
5553
});
5654
} catch (error) {
57-
console.log('Error sending message:', error);
55+
console.error('Error sending message:', error);
5856
}
5957
});
6058
}

‎src/popup/settings.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ document.addEventListener('DOMContentLoaded', () => {
3232
// Set up change listener
3333
themeSelect.addEventListener('change', () => {
3434
const selectedValue = themeSelect.value as 'dark' | 'light' | 'auto';
35-
console.log('Theme dropdown changed to:', selectedValue);
3635

3736
// Apply the selected theme
3837
setTheme(selectedValue);

‎src/utils/theme.ts

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,11 @@ const THEME_STYLES = {
5656

5757
// Initialize theme on load
5858
export function initializeTheme(): void {
59-
//console.log('Initializing theme...');
60-
6159
// Get saved theme settings
6260
chrome.storage.local.get(['isDarkTheme', 'themeMode', 'lastDetectedTheme'], (result) => {
6361
let theme: ThemeName = result.isDarkTheme ? 'dark' : 'light';
6462
const mode: ThemeMode = result.themeMode === 'auto' ? 'auto' : 'manual';
6563

66-
//console.log(`Theme settings: Theme=${theme}, Mode=${mode}`);
67-
6864
// For auto mode, use last detected theme if available
6965
if (mode === 'auto' && result.lastDetectedTheme) {
7066
theme = result.lastDetectedTheme;
@@ -82,8 +78,6 @@ export function initializeTheme(): void {
8278

8379
// Set theme based on dropdown selection
8480
export function setTheme(theme: ThemeName | 'auto'): void {
85-
//console.log(`Setting theme to: ${theme}`);
86-
8781
if (theme === 'auto') {
8882
// Enable auto mode but keep current theme until detection
8983
chrome.storage.local.get(['isDarkTheme'], (result) => {
@@ -103,8 +97,6 @@ export function setTheme(theme: ThemeName | 'auto'): void {
10397

10498
// Apply a theme to the current page
10599
function applyTheme(theme: ThemeName, mode: ThemeMode): void {
106-
//console.log(`Applying theme: ${theme}, mode: ${mode}`);
107-
108100
// Set data attribute for CSS variables
109101
document.documentElement.setAttribute('data-theme', theme);
110102

@@ -174,22 +166,18 @@ function updateThemeUI(theme: ThemeName, mode: ThemeMode): void {
174166

175167
// Detect theme from active LeetCode page
176168
function detectThemeFromPage(): void {
177-
//console.log('Detecting theme from active tab...');
178-
179169
chrome.tabs.query({ active: true, currentWindow: true }, (tabs) => {
180170
if (tabs[0]?.id) {
181171
chrome.tabs.sendMessage(
182172
tabs[0].id,
183173
{ action: 'getTheme' },
184174
(response) => {
185175
if (chrome.runtime.lastError) {
186-
//console.log('Error detecting theme:', chrome.runtime.lastError);
176+
console.error('Error detecting theme:', chrome.runtime.lastError);
187177
return;
188178
}
189179

190180
if (response?.theme) {
191-
//console.log('Detected theme:', response.theme);
192-
193181
// Apply the detected theme
194182
applyTheme(response.theme, 'auto');
195183
}

0 commit comments

Comments
(0)

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