globalseo
Advanced tools
Comparing version 2.2.39 to 2.2.40
@@ -25,3 +25,3 @@ const extractOptionsFromScript = require("./extractOptionsFromScript.js"); | ||
if (translationMode != 'subdomain' && translationMode != 'subdirectory' && shouldReplaceLinks && paramsLang && (paramsLang != originalLanguage)) { | ||
replaceLinks(window, {langParam, lang: paramsLang, translationMode: options.translationMode}); | ||
replaceLinks(window, {langParam, lang: paramsLang, translationMode: options.translationMode, sourceOrigin: options.sourceOrigin}); | ||
} | ||
@@ -28,0 +28,0 @@ getTranslations(window, apiKey, options) |
{ | ||
"name": "globalseo", | ||
"version": "2.2.39", | ||
"version": "2.2.40", | ||
"description": "Translate your React.js or Next.js app with AI", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
const getUnprefixedPathname = require("./utils/translation-mode/getUnprefixedPathname"); | ||
function replaceLinks(window, {langParam, lang, translationMode, prefix, sourceOriginHostname}) { | ||
function replaceLinks(window, {langParam, lang, translationMode, prefix, sourceOriginHostname, sourceOrigin}) { | ||
// Select all anchor tags | ||
@@ -29,3 +29,3 @@ const anchors = window.document.querySelectorAll('a:not(.globalseo-ignore-link)'); | ||
if (!anchor.href.startsWith("http") && !anchor.href.startsWith("tel:") && !anchor.href.startsWith("mailto:")) { | ||
const currentUrl = new URL(window.location.href); | ||
const currentUrl = new URL(sourceOrigin || window.location.href); | ||
const fullHref = `${currentUrl.protocol}//${currentUrl.hostname}${anchor.href}`; | ||
@@ -32,0 +32,0 @@ anchor.href = fullHref; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
590506