Skip to content

Add score-gated browsing controls to VSW extension - #10

Merged
AleksZyro merged 1 commit into
mainfrom
feature/coauth-extension-finalization
Jun 28, 2026
Merged

Add score-gated browsing controls to VSW extension#10
AleksZyro merged 1 commit into
mainfrom
feature/coauth-extension-finalization

Conversation

@AleksZyro

Copy link
Copy Markdown
Collaborator

What changed?

  • Added score-gated browsing controls to the VSW browser extension.
  • Added a "Scan and visit target" popup flow.
  • Added configurable minimum score before visiting a target.
  • Added automatic page tracking after navigation.
  • Updated extension documentation.

Why?

This makes the browser extension more useful for defensive browsing workflows. Users can scan a target first and only continue when the resulting report passes the configured score threshold.

Checks

  • node --check extensions/vsw-link-capture/background.js
  • node --check extensions/vsw-link-capture/content-script.js
  • node --check extensions/vsw-link-capture/popup.js

Collaboration

This contribution was created together with BotondCsereklye.

Co-authored-by: BotondCsereklye <178569310+BotondCsereklye@users.noreply.github.com>
@AleksZyro
AleksZyro merged commit 2e121f6 into main Jun 28, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the vsw-link-capture browser extension with score-gated navigation controls, allowing users to scan targets first and only proceed with navigation when a scan meets a configurable minimum score. It also adds an optional “auto-scan after navigation” mode to register direct/JS-driven visits.

Changes:

  • Added a new popup flow to “Scan and visit target” (manual domain/URL entry) with scan-before-visit behavior.
  • Introduced configurable minimum score gating (and optional blocking) plus background polling for scan completion.
  • Added automatic scanning of visited pages after top-level navigation and updated extension docs/version.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
extensions/vsw-link-capture/README.md Documents the new scan/visit flow, auto-scan mode, and score gating settings.
extensions/vsw-link-capture/popup.js Adds UI wiring for manual target scanning, new settings toggles, and persistence.
extensions/vsw-link-capture/popup.html Adds manual target input panel and new settings controls to the popup.
extensions/vsw-link-capture/manifest.json Bumps extension version to 0.3.0.
extensions/vsw-link-capture/background.js Implements scan polling, score-based gate decisions, scan-target-and-visit handling, and visited-page auto-scan tracking.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 171 to +176
if (result.ok) {
if (tabId !== undefined) {
rememberVisitedPage(tabId, rawUrl);
}

const gateDecision = evaluateGateDecision(result.detail, settings);
Comment on lines +46 to +52
chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {
if (changeInfo.status !== "complete") {
return;
}

void handleVisitedPage(tabId, tab?.url || changeInfo.url || null);
});
Comment on lines +371 to +390
const candidate = /^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
try {
const parsedUrl = new URL(candidate);
if (parsedUrl.protocol !== "http:" && parsedUrl.protocol !== "https:") {
return { ok: false, error: "Only http and https targets are supported." };
}

if (!parsedUrl.hostname) {
return { ok: false, error: "Could not extract host from target." };
}

return {
ok: true,
target: parsedUrl.hostname,
visitUrl: parsedUrl.toString(),
};
} catch (_error) {
return { ok: false, error: "Please enter a valid domain or URL." };
}
}
};
}

const score = typeof detail.score === "number" ? detail.score : null;
Comment on lines 102 to 110
const settings = {
liveCaptureEnabled: liveCaptureToggle.checked,
blockOnScanFailure: blockOnFailureToggle.checked,
autoScanVisitedPages: autoScanVisitedPagesToggle.checked,
minimumAllowedScore: Number.parseInt(minimumAllowedScoreInput.value || "50", 10),
blockBelowMinimumScore: blockBelowMinimumScoreToggle.checked,
};

const result = await chrome.runtime.sendMessage({
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants