@ludens-reklame/profiler-client
Advanced tools
Comparing version 0.2.6 to 0.2.7
@@ -21,3 +21,4 @@ interface Opts { | ||
name: string; | ||
code: string; | ||
js: string | null; | ||
html: string | null; | ||
} | ||
@@ -24,0 +25,0 @@ declare class Profiler { |
@@ -130,3 +130,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var personalizations, i, ps, scriptContent, scriptTag, error_4; | ||
var personalizations, i, ps, scriptTag, error_4; | ||
return __generator(this, function (_a) { | ||
@@ -142,12 +142,9 @@ switch (_a.label) { | ||
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); | ||
} | ||
if (ps.html) { | ||
document.body.insertAdjacentHTML('beforeend', ps.html); | ||
} | ||
else { | ||
document.body.insertAdjacentHTML('beforeend', ps.code); | ||
if (ps.js) { | ||
scriptTag = document.createElement('script'); | ||
scriptTag.innerHTML = ps.js; | ||
document.body.appendChild(scriptTag); | ||
} | ||
@@ -154,0 +151,0 @@ } |
{ | ||
"name": "@ludens-reklame/profiler-client", | ||
"version": "0.2.6", | ||
"version": "0.2.7", | ||
"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
14318
241