@absolutejs/beacon 0.7.0-beta.5 → 0.7.0-beta.6

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/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.5";
28
+ export declare const BEACON_SDK_VERSION = "0.7.0-beta.6";
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;
@@ -140,6 +140,9 @@ export type BeaconResourceFailure = {
140
140
  * `console.error`. Each detector is feature-gated and independently tunable.
141
141
  */
142
142
  export type BeaconSignals = {
143
+ /** Suppress synthetic watchdog findings while `navigator.webdriver` is true.
144
+ * Explicit exceptions and messages are unaffected. Default false. */
145
+ suppressAutomatedBrowsers?: boolean;
143
146
  /** Back/forward navigations the browser could not restore from bfcache. */
144
147
  bfcacheBlocks?: boolean;
145
148
  /** Browser-specific bfcache reason strings that are inherent to an
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.5";
202
+ var BEACON_SDK_VERSION = "0.7.0-beta.6";
203
203
  var inBrowser = () => typeof window !== "undefined";
204
204
  var newId = () => {
205
205
  if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
@@ -1247,6 +1247,8 @@ var createBeacon = (options) => {
1247
1247
  push(event);
1248
1248
  };
1249
1249
  const emitSignal = (message, signalTags, traceId, extra, stackBoundary, fallbackFramesToDrop = 1, useDefaultFingerprint = false) => {
1250
+ if (signals?.suppressAutomatedBrowsers === true && typeof navigator !== "undefined" && navigator.webdriver === true)
1251
+ return;
1250
1252
  if (staleClientRelease && signalTags.signal !== BEACON_SIGNAL.STALE_RELEASE && signalTags.signal !== BEACON_SIGNAL.RELOAD_LOOP)
1251
1253
  return;
1252
1254
  const error = new Error(message);
@@ -4074,6 +4076,9 @@ var createBeacon = (options) => {
4074
4076
  const restoredLifecycleClose = pageRestoredAt !== undefined && socketLifecycleGeneration < pageLifecycleGeneration && Date.now() - pageRestoredAt <= RESTORED_SOCKET_CLOSE_GRACE_MS;
4075
4077
  if (pageLifecycleEnding || applicationClose || restoredLifecycleClose)
4076
4078
  return;
4079
+ const expectedServerClose = typeof CloseEvent !== "undefined" && event instanceof CloseEvent && (event.wasClean || event.code === 1000 || event.code === 1001 || event.code === 1012);
4080
+ if (expectedServerClose)
4081
+ return;
4077
4082
  if (signals.socketAbnormalCloses !== false && typeof CloseEvent !== "undefined" && event instanceof CloseEvent && !event.wasClean && !recoverableSocket(socketUrl)) {
4078
4083
  const abnormalKey = `${label}|${event.code}`;
4079
4084
  if (!reportedAbnormalCloses.has(abnormalKey)) {
@@ -4812,5 +4817,5 @@ export {
4812
4817
  redactBeaconEvent
4813
4818
  };
4814
4819
 
4815
- //# debugId=69A1D614031FDB2864756E2164756E21
4820
+ //# debugId=B2E4D5B70391586864756E2164756E21
4816
4821
  //# sourceMappingURL=index.js.map