Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@abtasty/scroll-tracking

Package Overview
Dependencies
Maintainers
38
Versions
56
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@abtasty/scroll-tracking - npm Package Compare versions

Comparing version 3.4.5 to 3.4.6

2

dist/main.js

@@ -1,1 +0,1 @@

!function(){"use strict";const e="abtasty_executedCampaign",t=e=>{if((()=>{if(Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")||(()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t})())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})()){const t=(()=>{const e=(()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`})();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")})();window.console.log(`%c${t} - QA Mode for campaign ${TEST_ID}\n${e}`,"background-color: rgba(0, 127, 145, 1); color: rgba(247, 247, 247, 1)")}};let n,o=()=>null;const{engagementGoal:r,customTarget:c,scrollTarget:s}=DATA,a=()=>r.sort((e,t)=>e.percentage-t.percentage),l=["scroll",()=>u(),{passive:!0}],i=()=>{const e=c?document.querySelector(s):window;e&&e.removeEventListener(...l)},d=e=>{t("Widget launch"),n=a(),(c?e:window).addEventListener(...l)},u=()=>{const e=(()=>{const e=c?document.querySelector(s):document.body.scrollTop>0?document.body:document.documentElement;return e?100*e.scrollTop/(Math.max(e.scrollHeight,e.offsetHeight,e.clientHeight)-(c?e.parentElement.clientHeight:window.innerHeight)):0})();n=n.filter(n=>{let{percentage:o,name:r}=n;return!(e>=o&&(ABTastyEvent(r,null,TEST_ID),t(`Goal "${r}" sent to campaign ${TEST_ID}.`),1))}),n.length||i()},g=()=>{const e=((e,t)=>{const n=()=>{try{return document.querySelector(e)}catch(e){return null}};let o=n();const r=[document.body||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],c=()=>a.disconnect(),s=()=>a.observe(...r),a=new MutationObserver(()=>(o=n(),o&&!c()&&t(o)));return o?setTimeout(()=>t(o),0):s(),{selector:e,clear:c,observe:s}})(c?s:"body",d);o=e.clear},m=e=>{let{detail:{campaignId:t}}=e;t===TEST_ID&&(g(),p())},T=()=>{window.removeEventListener(e,m),i(),o(),n=a(),window.addEventListener(e,m)},p=()=>document.addEventListener("abtasty_resetActionTracking",T,{once:!0});g(),p()}();
!function(){"use strict";const e=e=>{const t=(()=>{if(Object.prototype.hasOwnProperty.call(window,"ABTastyEditor")||(()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t})())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})(),n=document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(t||n){const n=(()=>{const e=(()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`})();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")})();window.console.log(`%c${n} - ${t?"QA":"Debug"} Mode for campaign ${TEST_ID} %c ${e}`,"background-color: #D6FF01; color: #3100be; padding: 3px 0 3px 10px; border-radius: 5px 0 0 5px; font-weight: bold;","background-color: #3100be; color: white; padding: 3px 10px 3px 0; border-radius: 0 5px 5px 0;")}},t="abtasty_executedCampaign";let n,o=()=>null;const{engagementGoal:r,customTarget:c,scrollTarget:a}=DATA,s=()=>r.sort((e,t)=>e.percentage-t.percentage),i=["scroll",()=>u(),{passive:!0}],l=()=>{const e=c?document.querySelector(a):window;e&&e.removeEventListener(...i)},d=t=>{e("Widget launch"),n=s(),(c?t:window).addEventListener(...i)},u=()=>{const t=(()=>{const e=c?document.querySelector(a):document.body.scrollTop>0?document.body:document.documentElement;return e?100*e.scrollTop/(Math.max(e.scrollHeight,e.offsetHeight,e.clientHeight)-(c?e.parentElement.clientHeight:window.innerHeight)):0})();n=n.filter(n=>{let{percentage:o,name:r}=n;return!(t>=o&&(ABTastyEvent(r,null,TEST_ID),e(`Goal "${r}" sent to campaign ${TEST_ID}.`),1))}),n.length||l()},g=()=>{const e=((e,t)=>{const n=()=>{try{return document.querySelector(e)}catch(e){return null}};let o=n();const r=[document.body||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],c=()=>s.disconnect(),a=()=>s.observe(...r),s=new MutationObserver(()=>(o=n(),o&&!c()&&t(o)));return o?setTimeout(()=>t(o),0):a(),{selector:e,clear:c,observe:a}})(c?a:"body",d);o=e.clear},p=e=>{let{detail:{campaignId:t}}=e;t===TEST_ID&&(g(),b())},m=()=>{window.removeEventListener(t,p),l(),o(),n=s(),window.addEventListener(t,p)},b=()=>document.addEventListener("abtasty_resetActionTracking",m,{once:!0});g(),b()}();
{
"name": "@abtasty/scroll-tracking",
"description": "AB Tasty Widget",
"version": "3.4.5",
"version": "3.4.6",
"form": "dist/form.js",

@@ -6,0 +6,0 @@ "main": "dist/main.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc