mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-11 21:57:14 +03:00
* Fix: surface scan failures in extension popup for local files Scanning a local file:// page with "Allow access to file URLs" off left the popup stuck on "Scanning..." because the blocked content-script injection returned silently. ensureContentScriptInjected() now returns the real error, and sendScanToTab() sends a scan-failed message that the popup renders as a small line, with a permission hint shown only for file:// tabs. Fixes #258 Co-authored-by: Cursor <cursoragent@cursor.com> * Improve: report the actual error when a non-file scan fails The generic "This page can't be scanned." gave no reason. Non-file failures now read "Couldn't scan this page: <error>" so the user sees what Chrome reported instead of a dead end. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix: scope popup broadcasts to the active tab The popup acted on every findings-updated / scan-failed / overlays broadcast regardless of which tab it targeted, so a background or DevTools-driven rescan on another tab could reset the button or show a spurious error. Cache the active tab id and ignore broadcasts for other tabs. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor <cursoragent@cursor.com>
194 lines
3.4 KiB
CSS
194 lines
3.4 KiB
CSS
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
:root {
|
|
color-scheme: dark;
|
|
--ks-kinpaku: oklch(84% 0.19 80.46);
|
|
--ks-kinpaku-pale: oklch(86% 0.07 84);
|
|
--ks-patina: oklch(70% 0.12 188);
|
|
--ks-lacquer: oklch(7% 0.006 95);
|
|
--ks-lacquer-deep: oklch(4% 0.004 95);
|
|
--ks-text: oklch(88% 0 0);
|
|
--ks-text-muted: oklch(72% 0 0);
|
|
--ks-text-faint: oklch(62% 0 0);
|
|
--ks-rule: oklch(78% 0 0 / 0.16);
|
|
--popup-brand: var(--ks-kinpaku);
|
|
--ks-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
|
|
}
|
|
|
|
body {
|
|
width: 220px;
|
|
background: var(--ks-lacquer);
|
|
color: var(--ks-text);
|
|
font-family: system-ui, -apple-system, sans-serif;
|
|
font-size: 13px;
|
|
padding: 16px;
|
|
}
|
|
|
|
header {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 4px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.logo {
|
|
width: 26px;
|
|
height: 26px;
|
|
display: grid;
|
|
place-items: center;
|
|
color: var(--popup-brand);
|
|
}
|
|
|
|
.logo svg {
|
|
width: 22px;
|
|
height: 22px;
|
|
display: block;
|
|
}
|
|
|
|
h1 {
|
|
color: var(--popup-brand);
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
letter-spacing: 0.15em;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.count-display {
|
|
text-align: center;
|
|
padding: 16px 0;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.count-number {
|
|
display: block;
|
|
font-size: 36px;
|
|
font-weight: 700;
|
|
line-height: 1;
|
|
margin-bottom: 4px;
|
|
color: var(--ks-text-faint);
|
|
transition: color 0.2s;
|
|
}
|
|
|
|
.count-number.has-findings {
|
|
color: var(--ks-kinpaku);
|
|
}
|
|
|
|
.count-label {
|
|
font-size: 12px;
|
|
color: var(--ks-text-muted);
|
|
}
|
|
|
|
.actions {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 6px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.scan-error {
|
|
margin: -8px 0 16px;
|
|
font-size: 11px;
|
|
line-height: 1.4;
|
|
color: oklch(70% 0.13 30);
|
|
}
|
|
|
|
.scan-error[hidden] {
|
|
display: none;
|
|
}
|
|
|
|
.btn {
|
|
display: block;
|
|
width: 100%;
|
|
padding: 8px 12px;
|
|
border: 1px solid transparent;
|
|
border-radius: 2px;
|
|
font-size: 12px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
transition:
|
|
transform 180ms var(--ks-ease),
|
|
background-color 180ms var(--ks-ease),
|
|
border-color 180ms var(--ks-ease),
|
|
color 180ms var(--ks-ease),
|
|
opacity 0.15s;
|
|
}
|
|
|
|
.btn-primary {
|
|
background: var(--ks-kinpaku);
|
|
border-color: var(--ks-kinpaku);
|
|
color: var(--ks-lacquer-deep);
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: var(--ks-kinpaku-pale);
|
|
border-color: var(--ks-kinpaku-pale);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.btn-secondary {
|
|
background: transparent;
|
|
border-color: var(--ks-kinpaku);
|
|
color: var(--ks-kinpaku);
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: oklch(77% 0.14 82 / 0.08);
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.btn:focus-visible {
|
|
outline: 2px solid var(--ks-patina);
|
|
outline-offset: 3px;
|
|
}
|
|
|
|
footer {
|
|
text-align: center;
|
|
padding-top: 8px;
|
|
border-top: 1px solid var(--ks-rule);
|
|
}
|
|
|
|
footer a {
|
|
font-size: 11px;
|
|
color: var(--ks-text-muted);
|
|
text-decoration: none;
|
|
}
|
|
|
|
footer a:hover {
|
|
color: var(--popup-brand);
|
|
}
|
|
|
|
@media (prefers-color-scheme: light) {
|
|
:root {
|
|
color-scheme: light;
|
|
--ks-kinpaku-deep: oklch(61% 0.085 78);
|
|
--ks-lacquer: oklch(97% 0.012 95);
|
|
--ks-text: oklch(25% 0.018 95);
|
|
--ks-text-muted: oklch(45% 0.015 95);
|
|
--ks-text-faint: oklch(55% 0.012 95);
|
|
--ks-rule: oklch(25% 0.02 95 / 0.12);
|
|
--popup-brand: oklch(18% 0.02 95);
|
|
}
|
|
|
|
.count-number.has-findings {
|
|
color: var(--ks-kinpaku-deep);
|
|
}
|
|
|
|
.btn-primary {
|
|
color: oklch(14% 0.018 95);
|
|
}
|
|
|
|
.btn-secondary,
|
|
.btn-secondary:hover {
|
|
border-color: var(--ks-kinpaku-deep);
|
|
color: var(--ks-kinpaku-deep);
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: oklch(77% 0.13 82 / 0.10);
|
|
}
|
|
}
|