From 4635ce2926ed660c87a016a8834eafc2fcdcae07 Mon Sep 17 00:00:00 2001 From: Yann Date: Fri, 29 Nov 2024 16:33:25 +0100 Subject: [PATCH] Remove constant definition from global scope in embed.js (#33107) --- public/embed.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public/embed.js b/public/embed.js index 53372a3890..bc1fac3864 100644 --- a/public/embed.js +++ b/public/embed.js @@ -1,8 +1,5 @@ // @ts-check - -const allowedPrefixes = (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.dataset.allowedPrefixes) ? document.currentScript.dataset.allowedPrefixes.split(' ') : []; - -(function () { +(function (allowedPrefixes) { 'use strict'; /** @@ -127,4 +124,4 @@ const allowedPrefixes = (document.currentScript && document.currentScript.tagNam container.appendChild(iframe); }); }); -})(); +})((document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.dataset.allowedPrefixes) ? document.currentScript.dataset.allowedPrefixes.split(' ') : []);