Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 43 additions & 8 deletions background.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* debugHunter v2.0.0 - Background Service Worker
* debugHunter v2.0.1 - Background Service Worker
* Multi-factor detection with configurable comparison strategies
*/

Expand Down Expand Up @@ -180,6 +180,7 @@ const debugHeaders = [

async function getSettings() {
const result = await chrome.storage.sync.get([
'enabled',
'detectionMode',
'requireDebugIndicators',
'detectStatusChanges',
Expand All @@ -195,6 +196,7 @@ async function getSettings() {
]);

return {
enabled: result.enabled !== false, // Enabled by default
detectionMode: result.detectionMode || 'smart',
requireDebugIndicators: result.requireDebugIndicators !== false,
detectStatusChanges: result.detectStatusChanges !== false,
Expand Down Expand Up @@ -882,15 +884,18 @@ async function checkPaths(url) {
// ============================================================================

async function scanUrl(url) {
const settings = await getSettings();

// Check if scanning is enabled globally
if (!settings.enabled) return;

if (!await shouldScanUrl(url)) return;

const domain = new URL(url).hostname;
updateScanStatus({ active: true, domain });

console.log(`%c[debugHunter] Scanning: ${url}`, 'background: #9b59b6; color: white; padding: 2px 6px; border-radius: 3px');

const settings = await getSettings();

// Get baseline once for params and headers (saves 1 request)
const baseline = await getUrlBaseline(url);

Expand Down Expand Up @@ -945,6 +950,24 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
case 'getScanStatus':
sendResponse(scanStatus);
break;
case 'getEnabled': {
const enabledSettings = await getSettings();
sendResponse({ enabled: enabledSettings.enabled });
break;
}
case 'setEnabled': {
await chrome.storage.sync.set({ enabled: message.enabled });
// Update badge to reflect state
if (!message.enabled) {
chrome.action.setBadgeText({ text: 'OFF' });
chrome.action.setBadgeBackgroundColor({ color: '#6e7681' });
} else {
const currentFindings = await getFindings();
updateBadge(currentFindings);
}
sendResponse({ enabled: message.enabled });
break;
}
default:
sendResponse({ error: 'Unknown action' });
}
Expand All @@ -953,13 +976,25 @@ chrome.runtime.onMessage.addListener((message, sender, sendResponse) => {
});

chrome.runtime.onInstalled.addListener(async () => {
const findings = await getFindings();
updateBadge(findings);
const settings = await getSettings();
if (!settings.enabled) {
chrome.action.setBadgeText({ text: 'OFF' });
chrome.action.setBadgeBackgroundColor({ color: '#6e7681' });
} else {
const findings = await getFindings();
updateBadge(findings);
}
});

chrome.runtime.onStartup.addListener(async () => {
const findings = await getFindings();
updateBadge(findings);
const settings = await getSettings();
if (!settings.enabled) {
chrome.action.setBadgeText({ text: 'OFF' });
chrome.action.setBadgeBackgroundColor({ color: '#6e7681' });
} else {
const findings = await getFindings();
updateBadge(findings);
}
});

console.log('[debugHunter] Service worker v2.0.0 - Multi-factor detection');
console.log('[debugHunter] Service worker v2.0.1 - Multi-factor detection');
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 3,
"name": "debugHunter",
"version": "2.0.0",
"version": "2.0.1",
"description": "Discover hidden debugging parameters, headers, and sensitive paths to access dev/sandbox/pre-production environments",
"options_page": "options.html",
"icons": {
Expand Down
2 changes: 1 addition & 1 deletion options.html
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ <h2>Whitelist</h2>

<!-- Footer -->
<div class="footer">
<p>debugHunter v2.0 • <a href="https://github.com/devploit/debugHunter" target="_blank">GitHub</a> • Exposing what should stay hidden</p>
<p>debugHunter v2.0.1 • <a href="https://github.com/devploit/debugHunter" target="_blank">GitHub</a> • Exposing what should stay hidden</p>
</div>
</div>

Expand Down
2 changes: 1 addition & 1 deletion options.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* debugHunter v2.0.0 - Options Script
* debugHunter v2.0.1 - Options Script
* Advanced settings management
*/

Expand Down
75 changes: 74 additions & 1 deletion popup.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,72 @@
color: var(--critical);
}

/* Toggle Switch */
.toggle-switch {
display: flex;
align-items: center;
gap: 6px;
margin-right: 8px;
padding-right: 12px;
border-right: 1px solid var(--border-color);
}

.toggle-label {
font-size: 11px;
color: var(--text-secondary);
text-transform: uppercase;
font-weight: 500;
}

.toggle-container {
position: relative;
width: 36px;
height: 20px;
}

.toggle-input {
opacity: 0;
width: 0;
height: 0;
}

.toggle-slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: var(--bg-hover);
border-radius: 10px;
transition: all 0.2s ease;
}

.toggle-slider:before {
position: absolute;
content: "";
height: 14px;
width: 14px;
left: 3px;
bottom: 3px;
background-color: var(--text-muted);
border-radius: 50%;
transition: all 0.2s ease;
}

.toggle-input:checked + .toggle-slider {
background-color: var(--low);
}

.toggle-input:checked + .toggle-slider:before {
transform: translateX(16px);
background-color: white;
}

.toggle-input:focus + .toggle-slider {
box-shadow: 0 0 0 2px var(--accent);
}

/* Status Bar */
.status-bar {
display: none;
Expand Down Expand Up @@ -584,9 +650,16 @@
<i class="fas fa-bug"></i>
</div>
<span class="logo-text">debugHunter</span>
<span class="logo-version">v2.0</span>
<span class="logo-version">v2.0.1</span>
</div>
<div class="controls">
<div class="toggle-switch">
<span class="toggle-label">Scan</span>
<label class="toggle-container">
<input type="checkbox" class="toggle-input" id="scan-toggle" checked>
<span class="toggle-slider"></span>
</label>
</div>
<button class="control-btn" id="options-link" title="Settings">
<i class="fas fa-cog"></i>
</button>
Expand Down
22 changes: 20 additions & 2 deletions popup.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* debugHunter v2.0.0 - Popup Script
* debugHunter v2.0.1 - Popup Script
* Features: Diff viewer, Severity stats, Scan status
*/

Expand Down Expand Up @@ -31,6 +31,14 @@ async function getScanStatus() {
return await sendMessage('getScanStatus');
}

async function getEnabled() {
return await sendMessage('getEnabled');
}

async function setEnabled(enabled) {
return await sendMessage('setEnabled', { enabled });
}

// ============================================================================
// SEVERITY STATS
// ============================================================================
Expand Down Expand Up @@ -360,9 +368,19 @@ async function updateUI() {
// EVENT HANDLERS
// ============================================================================

document.addEventListener('DOMContentLoaded', () => {
document.addEventListener('DOMContentLoaded', async () => {
updateUI();

// Initialize scan toggle state
const scanToggle = document.getElementById('scan-toggle');
const enabledState = await getEnabled();
scanToggle.checked = enabledState.enabled;

// Scan toggle handler
scanToggle.addEventListener('change', async (e) => {
await setEnabled(e.target.checked);
});

// Category collapse toggle
document.querySelectorAll('.category-header').forEach((header) => {
header.addEventListener('click', () => {
Expand Down