@absolutejs/beacon 0.6.29 → 0.6.31
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 +14 -4
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1952,7 +1952,8 @@ var createBeacon = (options) => {
|
|
|
1952
1952
|
if (overflowX === "auto" || overflowX === "scroll")
|
|
1953
1953
|
return;
|
|
1954
1954
|
if (overflowX === "hidden" || overflowX === "clip") {
|
|
1955
|
-
const
|
|
1955
|
+
const horizontalContentWidth = Math.max(element.clientWidth, rect.width);
|
|
1956
|
+
const clipPx = element.scrollWidth - horizontalContentWidth;
|
|
1956
1957
|
if (clipPx > LAYOUT_OVERFLOW_CONTAINER_TOLERANCE_PX && style.textOverflow !== "ellipsis") {
|
|
1957
1958
|
reportOverflow(element, "clipped", "content is cut by overflow hidden", clipPx);
|
|
1958
1959
|
}
|
|
@@ -1998,6 +1999,12 @@ var createBeacon = (options) => {
|
|
|
1998
1999
|
}
|
|
1999
2000
|
return visible;
|
|
2000
2001
|
};
|
|
2002
|
+
const isExtensionOwnedCover = (element) => {
|
|
2003
|
+
if (element.tagName !== "IFRAME")
|
|
2004
|
+
return false;
|
|
2005
|
+
const source = element.getAttribute("src")?.trim().toLowerCase() ?? "";
|
|
2006
|
+
return source.startsWith("chrome-extension:") || source.startsWith("moz-extension:") || source.startsWith("safari-web-extension:");
|
|
2007
|
+
};
|
|
2001
2008
|
const scanForOcclusion = () => {
|
|
2002
2009
|
if (typeof document.elementFromPoint !== "function")
|
|
2003
2010
|
return;
|
|
@@ -2020,7 +2027,7 @@ var createBeacon = (options) => {
|
|
|
2020
2027
|
continue;
|
|
2021
2028
|
sampled += 1;
|
|
2022
2029
|
const top = document.elementFromPoint((visibleRect.left + visibleRect.right) / 2, (visibleRect.top + visibleRect.bottom) / 2);
|
|
2023
|
-
if (top === null || top === control || control.contains(top) || top.contains(control)) {
|
|
2030
|
+
if (top === null || top === control || control.contains(top) || top.contains(control) || isExtensionOwnedCover(top)) {
|
|
2024
2031
|
continue;
|
|
2025
2032
|
}
|
|
2026
2033
|
const topRect = top.getBoundingClientRect();
|
|
@@ -3590,12 +3597,15 @@ var createBeacon = (options) => {
|
|
|
3590
3597
|
registration.addEventListener("updatefound", onUpdateFound);
|
|
3591
3598
|
serviceWorkerListenerCleanups.push(() => registration.removeEventListener("updatefound", onUpdateFound));
|
|
3592
3599
|
};
|
|
3600
|
+
const isServiceWorkerRegistration = (registration) => typeof registration === "object" && registration !== null && ("installing" in registration) && typeof registration.addEventListener === "function";
|
|
3593
3601
|
const originalRegister = container.register;
|
|
3594
3602
|
const wrappedRegister = async function(scriptURL, registrationOptions) {
|
|
3595
3603
|
const endpointLabel = shortUrl(String(scriptURL));
|
|
3596
3604
|
try {
|
|
3597
3605
|
const registration = await originalRegister.call(this, scriptURL, registrationOptions);
|
|
3598
|
-
|
|
3606
|
+
if (isServiceWorkerRegistration(registration)) {
|
|
3607
|
+
watchRegistration(registration);
|
|
3608
|
+
}
|
|
3599
3609
|
return registration;
|
|
3600
3610
|
} catch (error) {
|
|
3601
3611
|
reportServiceWorkerFailure(endpointLabel, "registration", toError(error));
|
|
@@ -3945,5 +3955,5 @@ export {
|
|
|
3945
3955
|
BEACON_ATTRIBUTE
|
|
3946
3956
|
};
|
|
3947
3957
|
|
|
3948
|
-
//# debugId=
|
|
3958
|
+
//# debugId=072323A5FE172E3664756E2164756E21
|
|
3949
3959
|
//# sourceMappingURL=index.js.map
|