@absolutejs/beacon 0.7.0-beta.8 → 0.7.0-beta.9

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/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@absolutejs/beacon`.
4
+
5
+ This file is generated by `absolute-changelog` from the entries in
6
+ `changelog/`. Edit an entry, not this file — and add new ones under
7
+ `changelog/unreleased/`.
8
+
9
+ ## 0.7.0-beta.9 — 2026-09-27
10
+
11
+ ### Fixed
12
+
13
+ - **Exclude known 1Password notification covers and retain request origins in network-failure diagnostics without credentials or query strings. Same-origin grouping remains stable across environments. Keep layout pixel measurements out of fingerprints and include geometry and sticky/fixed ancestor context in collision and occlusion reports. Read only browser-exposed XHR response headers to avoid unsafe-header console errors while preserving available trace correlation.** (`createBeacon`, `BeaconNetworkFailure`, `BEACON_SDK_VERSION`)
package/changelog.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "contract": 1,
3
+ "name": "@absolutejs/beacon",
4
+ "releases": [
5
+ {
6
+ "changes": [
7
+ {
8
+ "kind": "fixed",
9
+ "summary": "Exclude known 1Password notification covers and retain request origins in network-failure diagnostics without credentials or query strings. Same-origin grouping remains stable across environments. Keep layout pixel measurements out of fingerprints and include geometry and sticky/fixed ancestor context in collision and occlusion reports. Read only browser-exposed XHR response headers to avoid unsafe-header console errors while preserving available trace correlation.",
10
+ "symbols": [
11
+ "createBeacon",
12
+ "BeaconNetworkFailure",
13
+ "BEACON_SDK_VERSION"
14
+ ]
15
+ }
16
+ ],
17
+ "date": "2026-09-27",
18
+ "version": "0.7.0-beta.9"
19
+ }
20
+ ]
21
+ }
package/dist/index.d.ts CHANGED
@@ -25,7 +25,7 @@ export type BeaconLevel = "fatal" | "error" | "warning" | "info";
25
25
  /** Response header used to correlate a browser signal with its server request. */
26
26
  export declare const BEACON_TRACE_HEADER = "x-absolute-trace-id";
27
27
  /** Beacon package version retained with every captured event. */
28
- export declare const BEACON_SDK_VERSION = "0.7.0-beta.8";
28
+ export declare const BEACON_SDK_VERSION = "0.7.0-beta.9";
29
29
  /** Arbitrary event tags, with Beacon's reserved `signal` tag type-checked. */
30
30
  export type BeaconTags = Record<string, string> & {
31
31
  signal?: BeaconSignal;
@@ -376,6 +376,9 @@ export type BeaconReleaseProbe = {
376
376
  }) => void;
377
377
  };
378
378
  export type BeaconNetworkFailure = {
379
+ /** Request origin only; credentials, path and query are never included. */
380
+ origin?: string;
381
+ sameOrigin?: boolean;
379
382
  at: number;
380
383
  durationMs: number;
381
384
  endpoint: string;
package/dist/index.js CHANGED
@@ -199,7 +199,7 @@ var consumeEarlyLayoutShiftBuffer = () => {
199
199
 
200
200
  // src/index.ts
201
201
  var BEACON_TRACE_HEADER = "x-absolute-trace-id";
202
- var BEACON_SDK_VERSION = "0.7.0-beta.8";
202
+ var BEACON_SDK_VERSION = "0.7.0-beta.9";
203
203
  var inBrowser = () => typeof window !== "undefined";
204
204
  var newId = () => {
205
205
  if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
@@ -605,6 +605,17 @@ var bfcacheLocation = (value) => {
605
605
  var UUID_PATH_SEGMENT = /\b[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}\b/giu;
606
606
  var LONG_IDENTIFIER_SEGMENT = /\b(?:[0-9a-f]{16,}|\d{8,})\b/giu;
607
607
  var VOLATILE_SIGNAL_TAGS = new Set([
608
+ "area",
609
+ "gapPx",
610
+ "overlapPx",
611
+ "surfaceColor",
612
+ "surfaceLuminance",
613
+ "targetBottomPx",
614
+ "targetHeightPx",
615
+ "targetLeftPx",
616
+ "targetRightPx",
617
+ "targetTopPx",
618
+ "targetWidthPx",
608
619
  "actionId",
609
620
  "actionTrusted",
610
621
  "automation",
@@ -1538,6 +1549,9 @@ var createBeacon = (options) => {
1538
1549
  method: methods.length === 1 ? methods[0] : "multiple",
1539
1550
  online: onlineStates.length === 1 ? onlineStates[0] : "mixed",
1540
1551
  reportDelayMs: String(reportDelayMs),
1552
+ requestOrigins: [
1553
+ ...new Set(failures.map((failure) => failure.sameOrigin === true ? "same-origin" : failure.origin ?? "unknown"))
1554
+ ].sort().join(","),
1541
1555
  signal: BEACON_SIGNAL.FETCH_FAILED,
1542
1556
  transport: transports.length === 1 ? transports[0] : "multiple",
1543
1557
  visibilityState: visibilityStates.length === 1 ? visibilityStates[0] : "mixed",
@@ -1546,6 +1560,19 @@ var createBeacon = (options) => {
1546
1560
  }
1547
1561
  };
1548
1562
  flushPendingNetworkFailures = flushNetworkFailures;
1563
+ const requestOrigin = (url) => {
1564
+ try {
1565
+ const parsed = new URL(url, location.href);
1566
+ if (parsed.protocol !== "http:" && parsed.protocol !== "https:")
1567
+ return {};
1568
+ return {
1569
+ origin: parsed.origin,
1570
+ sameOrigin: parsed.origin === location.origin
1571
+ };
1572
+ } catch {
1573
+ return {};
1574
+ }
1575
+ };
1549
1576
  const reportFailureSignal = (url, method, durationMs, transportKind, errorValue) => {
1550
1577
  if (signals === null || signals.failedRequests === false)
1551
1578
  return;
@@ -1558,6 +1585,7 @@ var createBeacon = (options) => {
1558
1585
  const properties = errorProperties(error);
1559
1586
  const state = networkState();
1560
1587
  const failure = {
1588
+ ...requestOrigin(url),
1561
1589
  at: Date.now(),
1562
1590
  durationMs,
1563
1591
  endpoint: shortUrl(url),
@@ -2245,7 +2273,7 @@ var createBeacon = (options) => {
2245
2273
  const seenScanIssues = new Set;
2246
2274
  let scanIssueReports = 0;
2247
2275
  const SCAN_ISSUE_MAX_REPORTS = 10;
2248
- const reportScanIssue = (element, signal, detail, extraTags) => {
2276
+ const reportScanIssue = (element, signal, detail, extraTags, extra) => {
2249
2277
  const bucket = viewportBucket();
2250
2278
  const key = `${signal}:${describeElement(element)}@${bucket}`;
2251
2279
  if (seenScanIssues.has(key))
@@ -2260,7 +2288,7 @@ var createBeacon = (options) => {
2260
2288
  target: describeElement(element),
2261
2289
  viewportBucket: bucket,
2262
2290
  viewportWidth: String(document.documentElement.clientWidth)
2263
- });
2291
+ }, undefined, extra);
2264
2292
  };
2265
2293
  const reportOverflow = (element, kind, detail, spillPx) => {
2266
2294
  const bucket = viewportBucket();
@@ -2387,6 +2415,8 @@ var createBeacon = (options) => {
2387
2415
  return visible;
2388
2416
  };
2389
2417
  const isExtensionOwnedCover = (element) => {
2418
+ if (element.closest("com-1password-notification") !== null)
2419
+ return true;
2390
2420
  if (element.tagName !== "IFRAME")
2391
2421
  return false;
2392
2422
  const source = element.getAttribute("src")?.trim().toLowerCase() ?? "";
@@ -2401,6 +2431,38 @@ var createBeacon = (options) => {
2401
2431
  const secondDialog = second.closest('[role="dialog"], dialog');
2402
2432
  return firstDialog === null !== (secondDialog === null);
2403
2433
  };
2434
+ const scanLayoutContext = (target, other) => {
2435
+ const geometry = (element) => {
2436
+ const rect = element.getBoundingClientRect();
2437
+ let positionedAncestor = element;
2438
+ while (positionedAncestor !== null && !["fixed", "sticky"].includes(window.getComputedStyle(positionedAncestor).position)) {
2439
+ positionedAncestor = positionedAncestor.parentElement;
2440
+ }
2441
+ return {
2442
+ rect: {
2443
+ top: rect.top,
2444
+ right: rect.right,
2445
+ bottom: rect.bottom,
2446
+ left: rect.left,
2447
+ width: rect.width,
2448
+ height: rect.height
2449
+ },
2450
+ position: window.getComputedStyle(element).position,
2451
+ ...positionedAncestor ? {
2452
+ positionedAncestor: describeElement(positionedAncestor),
2453
+ ancestorPosition: window.getComputedStyle(positionedAncestor).position
2454
+ } : {}
2455
+ };
2456
+ };
2457
+ return {
2458
+ layout: {
2459
+ target: geometry(target),
2460
+ other: geometry(other),
2461
+ scrollX: window.scrollX,
2462
+ scrollY: window.scrollY
2463
+ }
2464
+ };
2465
+ };
2404
2466
  const scanForControlCollisions = () => {
2405
2467
  const viewportWidth = document.documentElement.clientWidth;
2406
2468
  const viewportHeight = document.documentElement.clientHeight;
@@ -2447,7 +2509,7 @@ var createBeacon = (options) => {
2447
2509
  collisionAxis: axis2,
2448
2510
  collisionKind: "overlap",
2449
2511
  overlapPx: String(Math.round(axis2 === "vertical" ? overlapY : overlapX))
2450
- });
2512
+ }, scanLayoutContext(first.element, second.element));
2451
2513
  continue;
2452
2514
  }
2453
2515
  if (first.element.parentElement === second.element.parentElement || sharedIntentionalControlGroup(first.element, second.element) || first.positioned || second.positioned) {
@@ -2471,7 +2533,7 @@ var createBeacon = (options) => {
2471
2533
  collisionAxis: axis,
2472
2534
  collisionKind: "touching",
2473
2535
  gapPx: String(Math.round(axis === "vertical" ? verticalGap : horizontalGap))
2474
- });
2536
+ }, scanLayoutContext(first.element, second.element));
2475
2537
  }
2476
2538
  }
2477
2539
  };
@@ -2506,7 +2568,7 @@ var createBeacon = (options) => {
2506
2568
  const coverage = Math.max(overlapX, 0) * Math.max(overlapY, 0) / ((visibleRect.right - visibleRect.left) * (visibleRect.bottom - visibleRect.top));
2507
2569
  if (coverage < OCCLUSION_COVERAGE_MIN)
2508
2570
  continue;
2509
- reportScanIssue(control, BEACON_SIGNAL.OCCLUDED_CONTROL, `Occluded control — ${describeElement(control)} is covered by ${describeElement(top)}`, { coveredBy: describeElement(top) });
2571
+ reportScanIssue(control, BEACON_SIGNAL.OCCLUDED_CONTROL, `Occluded control — ${describeElement(control)} is covered by ${describeElement(top)}`, { coveredBy: describeElement(top) }, scanLayoutContext(control, top));
2510
2572
  }
2511
2573
  };
2512
2574
  const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
@@ -4657,15 +4719,15 @@ var createBeacon = (options) => {
4657
4719
  type: "xhr"
4658
4720
  });
4659
4721
  if (!failed) {
4660
- reportResponseSignal(request.url, request.method, this.status, Date.now() - start, responseTraceId(this.getResponseHeader(BEACON_TRACE_HEADER)));
4722
+ const headers = new Headers;
4723
+ for (const line of this.getAllResponseHeaders().split(/\r?\n/u)) {
4724
+ const separator = line.indexOf(":");
4725
+ if (separator <= 0)
4726
+ continue;
4727
+ headers.append(line.slice(0, separator).trim(), line.slice(separator + 1).trim());
4728
+ }
4729
+ reportResponseSignal(request.url, request.method, this.status, Date.now() - start, responseTraceId(headers.get(BEACON_TRACE_HEADER)));
4661
4730
  if ((instrument.classifyResponse !== undefined && this.status >= 200 && this.status < 300 || instrument.classifyErrorResponse !== undefined && this.status >= 400) && (this.responseType === "" || this.responseType === "text")) {
4662
- const headers = new Headers;
4663
- for (const line of this.getAllResponseHeaders().split(/\r?\n/u)) {
4664
- const separator = line.indexOf(":");
4665
- if (separator <= 0)
4666
- continue;
4667
- headers.append(line.slice(0, separator).trim(), line.slice(separator + 1).trim());
4668
- }
4669
4731
  classifyInstrumentedResponse(new Response(this.responseText, {
4670
4732
  headers,
4671
4733
  status: this.status,
@@ -4829,5 +4891,5 @@ export {
4829
4891
  redactBeaconEvent
4830
4892
  };
4831
4893
 
4832
- //# debugId=6833B5EED4A6D0D164756E2164756E21
4894
+ //# debugId=B62B708847BB02F164756E2164756E21
4833
4895
  //# sourceMappingURL=index.js.map