@absolutejs/beacon 0.6.23 → 0.6.24

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.js CHANGED
@@ -762,6 +762,7 @@ var createBeacon = (options) => {
762
762
  const rageCount = signals?.rageClickCount ?? RAGE_COUNT_DEFAULT;
763
763
  let networkRequestCount = 0;
764
764
  let externalNavigationCount = 0;
765
+ let externalShareCount = 0;
765
766
  let clipboardWriteCount = 0;
766
767
  let inSignalConsole = false;
767
768
  let pageLifecycleEnding = false;
@@ -1255,6 +1256,7 @@ var createBeacon = (options) => {
1255
1256
  const formBefore = snapshotRelevantFormControls(control);
1256
1257
  const networkRequestsBefore = networkRequestCount;
1257
1258
  const externalNavigationsBefore = externalNavigationCount;
1259
+ const externalSharesBefore = externalShareCount;
1258
1260
  const clipboardWritesBefore = clipboardWriteCount;
1259
1261
  let routerAcceptedNavigation = false;
1260
1262
  let mutated = false;
@@ -1266,7 +1268,7 @@ var createBeacon = (options) => {
1266
1268
  return;
1267
1269
  routerAcceptedNavigation = control instanceof HTMLAnchorElement && handledEvent.defaultPrevented;
1268
1270
  };
1269
- const responded = () => mutated || formStateChanged(formBefore) || location.href !== urlBefore || window.scrollY !== scrollBefore || document.activeElement !== activeBefore || networkRequestCount !== networkRequestsBefore || externalNavigationCount !== externalNavigationsBefore || clipboardWriteCount !== clipboardWritesBefore;
1271
+ const responded = () => mutated || formStateChanged(formBefore) || location.href !== urlBefore || window.scrollY !== scrollBefore || document.activeElement !== activeBefore || networkRequestCount !== networkRequestsBefore || externalNavigationCount !== externalNavigationsBefore || externalShareCount !== externalSharesBefore || clipboardWriteCount !== clipboardWritesBefore;
1270
1272
  const finish = (didRespond, navigationStalled = false) => {
1271
1273
  if (finished)
1272
1274
  return;
@@ -1673,6 +1675,20 @@ var createBeacon = (options) => {
1673
1675
  if (window.open === wrappedWindowOpen)
1674
1676
  window.open = originalWindowOpen;
1675
1677
  });
1678
+ if (typeof navigator !== "undefined" && typeof navigator.share === "function") {
1679
+ const originalShare = navigator.share;
1680
+ const wrappedShare = (...args) => {
1681
+ externalShareCount += 1;
1682
+ return originalShare.apply(navigator, args);
1683
+ };
1684
+ try {
1685
+ navigator.share = wrappedShare;
1686
+ cleanups.push(() => {
1687
+ if (navigator.share === wrappedShare)
1688
+ navigator.share = originalShare;
1689
+ });
1690
+ } catch {}
1691
+ }
1676
1692
  }
1677
1693
  let unresponsiveClicks = [];
1678
1694
  const onClick = (event) => {
@@ -3855,5 +3871,5 @@ export {
3855
3871
  BEACON_ATTRIBUTE
3856
3872
  };
3857
3873
 
3858
- //# debugId=E7F1511EB71CCCEF64756E2164756E21
3874
+ //# debugId=F390493D9649926964756E2164756E21
3859
3875
  //# sourceMappingURL=index.js.map