diff --git a/src/static/js/ace.js b/src/static/js/ace.js index c1c182728..12babadb7 100644 --- a/src/static/js/ace.js +++ b/src/static/js/ace.js @@ -255,13 +255,13 @@ plugins.ensure(function () {\n\ iframeHTML.push(' '); - // Expose myself to global for my child frame. - const thisFunctionsName = 'ChildAccessibleAce2Editor'; - (function () { return this; }())[thisFunctionsName] = Ace2Editor; + // eslint-disable-next-line node/no-unsupported-features/es-builtins + const gt = typeof globalThis === 'object' ? globalThis : window; + gt.ChildAccessibleAce2Editor = Ace2Editor; const outerScript = `\ editorId = ${JSON.stringify(info.id)};\n\ -editorInfo = parent[${JSON.stringify(thisFunctionsName)}].registry[editorId];\n\ +editorInfo = parent.ChildAccessibleAce2Editor.registry[editorId];\n\ window.onload = function () {\n\ window.onload = null;\n\ setTimeout(function () {\n\