sitecheckultra 2.0.3 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/public/index.html CHANGED
@@ -3,12 +3,12 @@
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>Site Check Ultra – Website, Speed, Mobile & WCAG Audit</title>
6
+ <title>Site Check Ultra – Website, Speed, Mobile & WCAG 2.2 Audit</title>
7
7
  <link rel="icon" type="image/png" href="/brand/site-check-ultra.png" />
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com" />
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
10
10
  <link href="https://fonts.googleapis.com/css2?family=Geist+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&display=swap" rel="stylesheet" />
11
- <link rel="stylesheet" href="/styles.css?v=dark-tech-7" />
11
+ <link rel="stylesheet" href="/styles.css?v=dark-tech-8" />
12
12
  </head>
13
13
  <body>
14
14
  <div id="app">
@@ -84,11 +84,11 @@
84
84
  <div class="subnav-actions">
85
85
  <span class="link-status-label" id="linkStatusLabel">Bereit.</span>
86
86
  <button class="btn btn-outline btn-xs" id="btnCheckLinks" disabled title="Interne &amp; externe Links auf 404 prüfen">Links prüfen</button>
87
- <button class="btn btn-outline btn-xs" id="btnExportCsv" disabled title="Aktuelle Ansicht als CSV exportieren">
87
+ <button class="btn btn-outline btn-xs" id="btnExportCsv" disabled title="Aktuelle Ansicht als CSV exportieren (bei Seiten: nur sichtbare Spalten)">
88
88
  <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" y1="15" x2="12" y2="3"/></svg>
89
89
  CSV
90
90
  </button>
91
- <button class="btn btn-excel btn-xs" id="btnExportXlsx" disabled title="Kompletten Crawl als Excel-Datei (.xlsx) mit mehreren Blättern herunterladen">
91
+ <button class="btn btn-excel btn-xs" id="btnExportXlsx" disabled title="Excel (.xlsx) – bei Seiten-Tab: sichtbare Spalten steuern das Blatt „Alle Seiten“ / Einzel-H">
92
92
  <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"/><polyline points="14 2 14 8 20 8"/><line x1="8" y1="13" x2="16" y2="17"/><line x1="16" y1="13" x2="8" y2="17"/></svg>
93
93
  Excel (.xlsx)
94
94
  </button>
@@ -280,7 +280,7 @@
280
280
  <div class="audit-top-bar card">
281
281
  <div class="card-header-row">
282
282
  <div>
283
- <h2>Automatische Website-Auswertung (SEO · AEO / KI · Hygiene · Speed · Mobile · WCAG)</h2>
283
+ <h2>Automatische Website-Auswertung (SEO · AEO / KI · Hygiene · Speed · Mobile · WCAG 2.2)</h2>
284
284
  <p class="muted" id="auditSubtitle">Jede Seite wird automatisch mit 0–100 Punkten und konkreten Begründungen bewertet.</p>
285
285
  </div>
286
286
  <div class="toolbar-actions">
@@ -298,7 +298,7 @@
298
298
  <div class="card-header-row" style="margin-bottom: 10px;">
299
299
  <div>
300
300
  <h2>Priorisierte Handlungsempfehlungen</h2>
301
- <p class="muted">Die wichtigsten SEO-, AEO-, Hygiene-, Speed-, Mobile- und WCAG-Hebel nach Auswirkung sortiert.</p>
301
+ <p class="muted">Die wichtigsten SEO-, AEO-, Hygiene-, Speed-, Mobile- und WCAG 2.2-Hebel nach Auswirkung sortiert.</p>
302
302
  </div>
303
303
  </div>
304
304
  <div class="table-container">
@@ -320,7 +320,7 @@
320
320
  <div class="card-header-row" style="margin-bottom: 10px;">
321
321
  <div>
322
322
  <h2>Seiten mit größtem Optimierungspotenzial (Top 20 schwächste Seiten)</h2>
323
- <p class="muted">Klicke auf eine Seite, um alle Abzüge &amp; Begründungen im Detail zu sehen. Kategorien: SEO · AEO · Hygiene · Speed · Mobile · WCAG.</p>
323
+ <p class="muted">Klicke auf eine Seite, um alle Abzüge &amp; Begründungen im Detail zu sehen. Kategorien: SEO · AEO · Hygiene · Speed · Mobile · WCAG 2.2.</p>
324
324
  </div>
325
325
  </div>
326
326
  <div class="table-container">
@@ -334,7 +334,7 @@
334
334
  <th class="num">HYGIENE</th>
335
335
  <th class="num">SPEED</th>
336
336
  <th class="num">MOBILE</th>
337
- <th class="num">WCAG</th>
337
+ <th class="num">WCAG 2.2</th>
338
338
  <th>HAUPT-BEGRÜNDUNG</th>
339
339
  </tr>
340
340
  </thead>
@@ -381,6 +381,15 @@
381
381
  <button class="btn btn-excel btn-xs" id="btnExportLinksXlsx">Links Excel</button>
382
382
  </div>
383
383
  </div>
384
+ <div class="job-progress hidden" id="linkCheckProgress" aria-live="polite">
385
+ <div class="job-progress-meta">
386
+ <strong id="linkCheckPhase">Prüfe Links…</strong>
387
+ <span class="job-progress-count" id="linkCheckMeta"></span>
388
+ </div>
389
+ <div class="progress-bar-wrap job-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" id="linkCheckBar">
390
+ <div class="progress-bar-fill" id="linkCheckBarFill"></div>
391
+ </div>
392
+ </div>
384
393
  <div class="toolbar-row" style="margin-top: 12px;">
385
394
  <div class="inline-filter-pills" id="linkFilterPills"></div>
386
395
  <input type="text" id="linkSearchInput" class="toolbar-search" placeholder="Ziel-URL, Linktext oder Quellseite filtern…" />
@@ -432,6 +441,15 @@
432
441
  <span>Oder alte Sitemap-URL automatisch laden</span>
433
442
  <input type="text" id="oldSitemapUrlInput" placeholder="https://alt.deine-seite.de/sitemap.xml" />
434
443
  <button class="btn btn-primary" id="btnRunRedirectCheck" style="margin-top: 10px;">Redirects jetzt prüfen</button>
444
+ <div class="job-progress hidden" id="redirectCheckProgress" aria-live="polite" style="margin-top: 10px;">
445
+ <div class="job-progress-meta">
446
+ <strong id="redirectCheckPhase">Prüfe Weiterleitungen…</strong>
447
+ <span class="job-progress-count" id="redirectCheckMeta"></span>
448
+ </div>
449
+ <div class="progress-bar-wrap job-progress-bar" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0" id="redirectCheckBar">
450
+ <div class="progress-bar-fill" id="redirectCheckBarFill"></div>
451
+ </div>
452
+ </div>
435
453
  <span class="muted small" id="redirectCheckStatus"></span>
436
454
  </div>
437
455
  </div>
@@ -653,6 +671,6 @@
653
671
  <!-- Toast Notification -->
654
672
  <div class="toast hidden" id="toast"></div>
655
673
 
656
- <script type="module" src="/app.js?v=dark-tech-7"></script>
674
+ <script type="module" src="/app.js?v=dark-tech-8"></script>
657
675
  </body>
658
676
  </html>
package/public/styles.css CHANGED
@@ -811,6 +811,51 @@ body {
811
811
  to { background-position: 40px 0; }
812
812
  }
813
813
 
814
+ /* Inline job progress (Link-Check / Redirect-Check) — same language as crawl bar */
815
+ .job-progress {
816
+ display: flex;
817
+ flex-direction: column;
818
+ gap: 6px;
819
+ width: 100%;
820
+ max-width: 420px;
821
+ margin-top: 8px;
822
+ }
823
+ .job-progress.hidden { display: none !important; }
824
+ .job-progress-meta {
825
+ display: flex;
826
+ align-items: baseline;
827
+ justify-content: space-between;
828
+ gap: 10px;
829
+ font-size: 12.5px;
830
+ color: var(--text-secondary);
831
+ }
832
+ .job-progress-meta strong {
833
+ color: var(--accent);
834
+ font-weight: 650;
835
+ }
836
+ .job-progress-count {
837
+ font-variant-numeric: tabular-nums;
838
+ color: var(--text-muted);
839
+ white-space: nowrap;
840
+ }
841
+ .job-progress-bar {
842
+ width: 100%;
843
+ max-width: 420px;
844
+ }
845
+
846
+ /* Brief flash when deep-linking into a drawer section */
847
+ @keyframes drawer-focus-pulse {
848
+ 0% { outline-color: transparent; background-color: transparent; }
849
+ 15% { outline-color: rgba(245, 158, 11, 0.65); background-color: rgba(245, 158, 11, 0.1); }
850
+ 100% { outline-color: transparent; background-color: transparent; }
851
+ }
852
+ .drawer-focus-flash {
853
+ outline: 2px solid rgba(245, 158, 11, 0.55);
854
+ outline-offset: 3px;
855
+ border-radius: var(--radius);
856
+ animation: drawer-focus-pulse 1.25s ease-out;
857
+ }
858
+
814
859
  /* Schimmernder Kopfpunkt gibt echte "Lebendigkeit" */
815
860
  .progress-bar-fill::before {
816
861
  content: '';
@@ -3050,7 +3095,7 @@ select:focus-visible {
3050
3095
  .link-origin-btn b { color: #52a8ff; font-weight: 600; }
3051
3096
 
3052
3097
  /* ==================== BILD-VORSCHAU (ALT-FEHLER) ==================== */
3053
- /* Klickbarer Alt-Fehler-Eintrag mit Bild-Thumbnail + Lightbox-Großansicht. */
3098
+ /* Alt-Fehler-Eintrag: Thumbnail; Klick öffnet Seitenvorschau (Lightbox optional). */
3054
3099
  .img-issue-box {
3055
3100
  display: flex;
3056
3101
  flex-direction: row;
@@ -3142,6 +3187,98 @@ select:focus-visible {
3142
3187
  .img-lightbox-open { color: #52a8ff; text-decoration: none; }
3143
3188
  .img-lightbox-open:hover { text-decoration: underline; }
3144
3189
 
3190
+ /* ==================== SEITENVORSCHAU (BILD IN KONTEXT) ==================== */
3191
+ /* Modal with iframe of re-fetched page HTML; injected script scrolls/highlights the img. */
3192
+ .page-img-preview-backdrop {
3193
+ z-index: 330;
3194
+ display: flex;
3195
+ align-items: center;
3196
+ justify-content: center;
3197
+ padding: 16px;
3198
+ }
3199
+ .page-img-preview-card {
3200
+ display: flex;
3201
+ flex-direction: column;
3202
+ width: min(1100px, calc(100vw - 24px));
3203
+ height: min(88vh, 860px);
3204
+ background: #0a0a0a;
3205
+ border: 1px solid var(--border-strong, #333);
3206
+ border-radius: 12px;
3207
+ overflow: hidden;
3208
+ }
3209
+ .page-img-preview-head {
3210
+ display: flex;
3211
+ align-items: flex-start;
3212
+ justify-content: space-between;
3213
+ gap: 12px;
3214
+ padding: 12px 16px;
3215
+ border-bottom: 1px solid var(--border);
3216
+ flex-shrink: 0;
3217
+ }
3218
+ .page-img-preview-titles {
3219
+ display: flex;
3220
+ flex-direction: column;
3221
+ gap: 4px;
3222
+ min-width: 0;
3223
+ }
3224
+ .page-img-preview-titles strong {
3225
+ font-size: 14px;
3226
+ color: #ededed;
3227
+ }
3228
+ .page-img-preview-url {
3229
+ font-size: 11.5px;
3230
+ color: #999;
3231
+ word-break: break-all;
3232
+ }
3233
+ .page-img-preview-status {
3234
+ padding: 8px 16px;
3235
+ border-bottom: 1px solid var(--border);
3236
+ flex-shrink: 0;
3237
+ }
3238
+ .page-img-preview-status.is-miss {
3239
+ color: #fca5a5;
3240
+ background: rgba(239, 68, 68, 0.08);
3241
+ }
3242
+ .page-img-preview-status.is-ok {
3243
+ color: #fcd34d;
3244
+ background: rgba(245, 158, 11, 0.08);
3245
+ }
3246
+ .page-img-preview-frame-wrap {
3247
+ position: relative;
3248
+ flex: 1 1 auto;
3249
+ min-height: 0;
3250
+ background: #fff;
3251
+ }
3252
+ .page-img-preview-loading {
3253
+ position: absolute;
3254
+ inset: 0;
3255
+ display: flex;
3256
+ align-items: center;
3257
+ justify-content: center;
3258
+ padding: 24px;
3259
+ text-align: center;
3260
+ background: #111;
3261
+ color: #ccc;
3262
+ font-size: 13px;
3263
+ z-index: 1;
3264
+ }
3265
+ .page-img-preview-frame {
3266
+ display: block;
3267
+ width: 100%;
3268
+ height: 100%;
3269
+ border: 0;
3270
+ background: #fff;
3271
+ }
3272
+ .page-img-preview-foot {
3273
+ display: flex;
3274
+ flex-wrap: wrap;
3275
+ justify-content: flex-end;
3276
+ gap: 8px;
3277
+ padding: 10px 16px 12px;
3278
+ border-top: 1px solid var(--border);
3279
+ flex-shrink: 0;
3280
+ }
3281
+
3145
3282
  /* Definitive dark surfaces; blue is reserved for focus and active selection. */
3146
3283
  .filter-strip,
3147
3284
  #pagesFilterBar {
package/server.js CHANGED
@@ -3,6 +3,7 @@ import path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { crawlManager } from './lib/crawler.js';
5
5
  import { buildCsvContent, buildExcelBuffer, buildHtmlAuditReport } from './lib/exporter.js';
6
+ import { createPagePreview, resolvePreviewAuth } from './lib/page-preview.js';
6
7
  import { findLocalBrowserPath } from './lib/renderer.js';
7
8
  import { discoverSitemap } from './lib/sitemap.js';
8
9
  import { discoverSiteAssets } from './lib/branding.js';
@@ -187,6 +188,44 @@ app.get('/api/crawls/:id', validateCrawlId, async (req, res) => {
187
188
  res.json({ crawl });
188
189
  });
189
190
 
191
+ /**
192
+ * Same-origin page preview for missing-alt images.
193
+ * Re-fetches the crawled page HTML, injects <base href> + locator script.
194
+ * Query: url (page URL), targetSrc (image src to find).
195
+ * Auth: active-crawl credentials, or Authorization: Basic from the client (state.lastAuth).
196
+ * Response: text/html preview document, or JSON error.
197
+ */
198
+ app.get('/api/crawls/:id/pages/preview', validateCrawlId, async (req, res) => {
199
+ try {
200
+ const crawl = await crawlManager.getCrawl(req.params.id);
201
+ if (!crawl) return res.status(404).json({ error: 'Crawl nicht gefunden.' });
202
+
203
+ const active = crawlManager.getActive(req.params.id);
204
+ const auth = resolvePreviewAuth(active?.auth || null, req.headers.authorization);
205
+
206
+ const result = await createPagePreview({
207
+ crawl,
208
+ pageUrl: req.query.url,
209
+ targetSrc: req.query.targetSrc,
210
+ auth
211
+ });
212
+
213
+ if (!result.ok) {
214
+ return res.status(result.status || 502).json({ error: result.error || 'Vorschau fehlgeschlagen.' });
215
+ }
216
+
217
+ // Allow embedding in our own UI iframe (global middleware sets DENY).
218
+ res.removeHeader('X-Frame-Options');
219
+ res.setHeader('Content-Security-Policy', "default-src * 'unsafe-inline' 'unsafe-eval' data: blob:; frame-ancestors 'self'; img-src * data: blob:; media-src * data: blob:; font-src * data:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'");
220
+ res.setHeader('Content-Type', 'text/html; charset=utf-8');
221
+ res.setHeader('Cache-Control', 'no-store');
222
+ res.send(result.html);
223
+ } catch (err) {
224
+ console.error('Page preview failed:', err?.message || err);
225
+ res.status(500).json({ error: 'Seitenvorschau konnte nicht erzeugt werden.' });
226
+ }
227
+ });
228
+
190
229
  // Resolve favicon and site-logo fallback for legacy crawls.
191
230
  // Response: { siteIcon: string|null, siteLogo: string|null } (absolute HTTP(S) asset URLs).
192
231
  app.get('/api/crawls/:id/branding', validateCrawlId, async (req, res) => {
@@ -269,6 +308,15 @@ app.patch('/api/crawls/:id/note', async (req, res) => {
269
308
  res.json({ ok: true, note: page.note });
270
309
  });
271
310
 
311
+ // Live progress for in-flight link / redirect checks (polled while POST is still open)
312
+ app.get('/api/crawls/:id/check-progress', validateCrawlId, (req, res) => {
313
+ const type = String(req.query.type || '').toLowerCase();
314
+ if (type !== 'links' && type !== 'redirects') {
315
+ return res.status(400).json({ error: 'Query type=links|redirects erforderlich.' });
316
+ }
317
+ res.json({ progress: crawlManager.getCheckProgress(req.params.id, type) });
318
+ });
319
+
272
320
  // Trigger link check
273
321
  app.post('/api/crawls/:id/check-links', validateCrawlId, async (req, res) => {
274
322
  try {
@@ -287,6 +335,13 @@ app.post('/api/crawls/:id/check-redirects', validateCrawlId, async (req, res) =>
287
335
  let allEntries = Array.isArray(entries) ? [...entries] : [];
288
336
 
289
337
  if (oldSitemapUrl && oldSitemapUrl.trim()) {
338
+ crawlManager.setCheckProgress(req.params.id, 'redirects', {
339
+ status: 'running',
340
+ checked: 0,
341
+ total: 0,
342
+ phase: 'Lade alte Sitemap…',
343
+ error: null
344
+ });
290
345
  const smUrl = oldSitemapUrl.trim();
291
346
  const smOrigin = new URL(smUrl).origin;
292
347
  const discovered = await discoverSitemap(smOrigin, auth, [smUrl], 3000);
@@ -309,13 +364,21 @@ app.post('/api/crawls/:id/check-redirects', validateCrawlId, async (req, res) =>
309
364
  }
310
365
  });
311
366
 
367
+ function parseExportColumns(queryCols) {
368
+ if (queryCols === undefined || queryCols === null || queryCols === '') return undefined;
369
+ const raw = Array.isArray(queryCols) ? queryCols.join(',') : String(queryCols);
370
+ const ids = raw.split(',').map((s) => s.trim()).filter(Boolean);
371
+ return ids.length > 0 ? ids : undefined;
372
+ }
373
+
312
374
  // CSV Export (UTF-8 BOM + Semicolon for seamless German Excel compatibility, dynamic H1..HN columns)
313
375
  app.get('/api/crawls/:id/export.csv', validateCrawlId, async (req, res) => {
314
376
  const crawl = await crawlManager.getCrawl(req.params.id);
315
377
  if (!crawl) return res.status(404).send('Crawl nicht gefunden');
316
378
 
317
379
  const type = String(req.query.type || 'pages');
318
- const csv = buildCsvContent(crawl, type);
380
+ const columns = parseExportColumns(req.query.cols);
381
+ const csv = buildCsvContent(crawl, type, columns ? { columns } : {});
319
382
  const hostSlug = new URL(crawl.origin).host.replace(/[^a-zA-Z0-9.-]/g, '_');
320
383
  res.setHeader('Content-Type', 'text/csv; charset=utf-8');
321
384
  res.setHeader('Content-Disposition', `attachment; filename="site-checker-${type}-${hostSlug}.csv"`);
@@ -329,7 +392,8 @@ const handleExcelExport = async (req, res) => {
329
392
  if (!crawl) return res.status(404).send('Crawl nicht gefunden');
330
393
 
331
394
  const type = String(req.query.type || 'all');
332
- const buffer = await buildExcelBuffer(crawl, type);
395
+ const columns = parseExportColumns(req.query.cols);
396
+ const buffer = await buildExcelBuffer(crawl, type, columns ? { columns } : {});
333
397
  const hostSlug = new URL(crawl.origin).host.replace(/[^a-zA-Z0-9.-]/g, '_');
334
398
  res.setHeader('Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
335
399
  res.setHeader('Content-Disposition', `attachment; filename="site-checker-${type}-${hostSlug}.xlsx"`);