From 141fd234140e9fffe08ef1b395ae4d879c8e0dd1 Mon Sep 17 00:00:00 2001 From: Jemika Negara <42384614+jemikanegara@users.noreply.github.com> Date: Mon, 20 Nov 2023 21:21:01 +0800 Subject: [PATCH] fix weployScriptTag --- browser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/browser.js b/browser.js index 5dd9552..7f1a7b6 100644 --- a/browser.js +++ b/browser.js @@ -1,10 +1,10 @@ const { getTranslations, isBrowser, createLanguageSelect } = require("./index.js"); if (isBrowser) { - var weployScriptTag = document.currentScript; + window.weployScriptTag = document.currentScript; document.addEventListener("DOMContentLoaded", function() { - const apiKey = weployScriptTag.getAttribute("data-weploy-key"); - const disableAutoTranslateAttr = weployScriptTag.getAttribute("data-disable-auto-translate") + const apiKey = window.weployScriptTag.getAttribute("data-weploy-key"); + const disableAutoTranslateAttr = window.weployScriptTag.getAttribute("data-disable-auto-translate") const disableAutoTranslate = disableAutoTranslateAttr == "true"; getTranslations(apiKey, {disableAutoTranslate}); createLanguageSelect(apiKey);