@ludens-reklame/profiler-client
Advanced tools
Comparing version 0.2.5 to 0.2.6
@@ -130,3 +130,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var personalizations_1, error_4; | ||
var personalizations, i, ps, scriptContent, scriptTag, error_4; | ||
return __generator(this, function (_a) { | ||
@@ -139,19 +139,17 @@ switch (_a.label) { | ||
case 1: | ||
personalizations_1 = _a.sent(); | ||
document.addEventListener('DOMContentLoaded', function () { | ||
for (var i = 0; i < personalizations_1.length; i++) { | ||
var ps = personalizations_1[i]; | ||
if (ps.code.includes('<script>')) { | ||
var scriptContent = ps.code.match(new RegExp('<script>' + '(.*)' + '</script>')); | ||
if (scriptContent && scriptContent.length > 1) { | ||
var scriptTag = document.createElement('script'); | ||
scriptTag.innerHTML = scriptContent[1]; | ||
document.body.appendChild(scriptTag); | ||
} | ||
personalizations = _a.sent(); | ||
for (i = 0; i < personalizations.length; i++) { | ||
ps = personalizations[i]; | ||
if (ps.code.includes('<script>')) { | ||
scriptContent = ps.code.match(new RegExp('<script>' + '(.*)' + '</script>')); | ||
if (scriptContent && scriptContent.length > 1) { | ||
scriptTag = document.createElement('script'); | ||
scriptTag.innerHTML = scriptContent[1]; | ||
document.body.appendChild(scriptTag); | ||
} | ||
else { | ||
document.body.insertAdjacentHTML('beforeend', ps.code); | ||
} | ||
} | ||
}); | ||
else { | ||
document.body.insertAdjacentHTML('beforeend', ps.code); | ||
} | ||
} | ||
_a.label = 2; | ||
@@ -158,0 +156,0 @@ case 2: return [3 /*break*/, 4]; |
{ | ||
"name": "@ludens-reklame/profiler-client", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"description": "Profiler for all", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
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
14733
243