From 9d1ea40f382ba307d957c15b0889b23a744a179c Mon Sep 17 00:00:00 2001 From: Jemika Negara Date: Wed, 30 Oct 2024 17:26:44 +0800 Subject: [PATCH] fix canonical link in original site --- extractOptionsFromScript.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extractOptionsFromScript.js b/extractOptionsFromScript.js index f97f3bc..9c025c9 100644 --- a/extractOptionsFromScript.js +++ b/extractOptionsFromScript.js @@ -185,7 +185,7 @@ function extractOptionsFromScript(window, optsArgs = { } if (translationMode == "subdomain") { - if (activeLang == originalLang) { + if (!activeLang || (activeLang == originalLang)) { newCanonicalLinkTag.href = `${window.location.protocol}//${domain}${window.location.pathname}`; } else { // Create a new URL object