landing-page-experiments
Advanced tools
Comparing version 1.0.14 to 1.0.15
@@ -118,13 +118,9 @@ "use strict"; | ||
resetBody: function () { | ||
if (__sbpd !== null) { | ||
document.body.style.display = __sbpd; | ||
var sbpd = document.getElementById('__sbpd'); | ||
if (sbpd) { | ||
sbpd.parentElement.removeChild(sbpd); | ||
} | ||
} | ||
}; | ||
var __sbpd = null; | ||
if (document.currentScript && document.currentScript.src) { | ||
window.addEventListener('DOMContentLoaded', function () { | ||
__sbpd = document.body.style.display; | ||
document.body.style.display = 'none'; | ||
}); | ||
var url = new URL(document.currentScript.src); | ||
@@ -134,4 +130,5 @@ var apiKey = url.searchParams.get('apikey'); | ||
if (apiKey && expId) { | ||
document.write('<style id="__sbpd">body { display: none; }</style>'); | ||
StatsigABHelper.performRedirect(apiKey, expId); | ||
} | ||
} |
{ | ||
"name": "landing-page-experiments", | ||
"version": "1.0.14", | ||
"version": "1.0.15", | ||
"description": "Statsig helps run landing page experiments by redirecting users to two or more landing pages based on an ABn Test.", | ||
@@ -5,0 +5,0 @@ "jsdelivr": "dist/index.js", |
@@ -75,4 +75,5 @@ window["StatsigABHelper"] = window["StatsigABHelper"] || { | ||
resetBody: function() { | ||
if (__sbpd !== null) { | ||
document.body.style.display = __sbpd; | ||
const sbpd = document.getElementById('__sbpd'); | ||
if (sbpd) { | ||
sbpd.parentElement.removeChild(sbpd); | ||
} | ||
@@ -82,8 +83,3 @@ } | ||
var __sbpd = null; | ||
if (document.currentScript && document.currentScript.src) { | ||
window.addEventListener('DOMContentLoaded', () => { | ||
__sbpd = document.body.style.display; | ||
document.body.style.display = 'none'; | ||
}); | ||
const url = new URL(document.currentScript.src); | ||
@@ -93,4 +89,5 @@ const apiKey = url.searchParams.get('apikey'); | ||
if (apiKey && expId) { | ||
document.write('<style id="__sbpd">body { display: none; }</style>'); | ||
StatsigABHelper.performRedirect(apiKey, expId); | ||
} | ||
} |
@@ -51,8 +51,9 @@ window["StatsigABHelper"] = window["StatsigABHelper"] || { | ||
if (currentUrl.pathname == newUrl.pathname) { | ||
if (__sbpd !== null) { | ||
document.body.style.display = __sbpd; | ||
} | ||
return; | ||
} | ||
window.location.replace(url); | ||
const sbpd = document.getElementById('__sbpd'); | ||
if (sbpd) { | ||
sbpd.parentElement.removeChild(sbpd); | ||
} | ||
// window.location.replace(url); | ||
}, | ||
@@ -73,5 +74,2 @@ | ||
.finally(() => { | ||
if (__sbpd !== null) { | ||
document.body.style.display = __sbpd; | ||
} | ||
}); | ||
@@ -81,8 +79,4 @@ } | ||
var __sbpd = null; | ||
if (document.currentScript && document.currentScript.src) { | ||
window.addEventListener('DOMContentLoaded', () => { | ||
__sbpd = document.body.style.display; | ||
document.body.style.display = 'none'; | ||
}); | ||
document.write('<style id="__sbpd">body { display: none; }</style>'); | ||
const url = new URL(document.currentScript.src); | ||
@@ -89,0 +83,0 @@ const apiKey = url.searchParams.get('apikey'); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13759
342