@absolutejs/beacon 0.6.23 → 0.6.25
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 +23 -3
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
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) => {
|
|
@@ -3199,7 +3215,11 @@ var createBeacon = (options) => {
|
|
|
3199
3215
|
reportFormAbandonmentOnNavigation = report;
|
|
3200
3216
|
document.addEventListener("input", onInput, true);
|
|
3201
3217
|
document.addEventListener("submit", onSubmit, true);
|
|
3202
|
-
const reportOnPageHide = () =>
|
|
3218
|
+
const reportOnPageHide = (event) => {
|
|
3219
|
+
if (event.persisted)
|
|
3220
|
+
return;
|
|
3221
|
+
report();
|
|
3222
|
+
};
|
|
3203
3223
|
window.addEventListener("pagehide", reportOnPageHide);
|
|
3204
3224
|
cleanups.push(() => {
|
|
3205
3225
|
reportFormAbandonmentOnNavigation = null;
|
|
@@ -3855,5 +3875,5 @@ export {
|
|
|
3855
3875
|
BEACON_ATTRIBUTE
|
|
3856
3876
|
};
|
|
3857
3877
|
|
|
3858
|
-
//# debugId=
|
|
3878
|
+
//# debugId=A4D85B3BFDFC197064756E2164756E21
|
|
3859
3879
|
//# sourceMappingURL=index.js.map
|