globalseo
Advanced tools
Comparing version 2.2.7 to 2.2.8
{ | ||
"name": "globalseo", | ||
"version": "2.2.7", | ||
"version": "2.2.8", | ||
"description": "Translate your React.js or Next.js app with AI", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -16,3 +16,2 @@ const { getGlobalseoActiveLang, getGlobalseoOptions } = require("../configs"); | ||
// get all elements with src attribute | ||
["src", "srcset"].forEach(attr => { | ||
@@ -53,2 +52,24 @@ try { | ||
}) | ||
// replace all internal links behavior to force reload using window.location.href | ||
const links = window.document.querySelectorAll("a"); | ||
links.forEach(link => { | ||
try { | ||
const href = link.href; | ||
const url = new URL(href); | ||
const origin = url.origin; | ||
if (origin == window.location.origin) { | ||
// add onclick | ||
link.onclick = (e) => { | ||
e.preventDefault(); | ||
window.location.href = href; | ||
return true; | ||
} | ||
} | ||
} catch(err) { | ||
// do nothing | ||
} | ||
}) | ||
} | ||
@@ -55,0 +76,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
564938
3501