New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

globalseo

Package Overview
Dependencies
Maintainers
0
Versions
127
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

globalseo - npm Package Compare versions

Comparing version 2.1.92 to 2.1.93

50

browser.js

@@ -8,28 +8,36 @@ const extractOptionsFromScript = require("./extractOptionsFromScript.js");

if (isBrowser()) {
window.translationScriptTag = window.document.currentScript;
window.translationScriptPrevVersion = PREV_SCRIPT_VERSION // called prev version because it will bumped after published to npm
try {
// prevent multiple scripts execution
if (window.firstGlobalseoScriptExecuted) throw new Error("Script already executed");
window.firstGlobalseoScriptExecuted = true;
const options = extractOptionsFromScript(window)
const {shouldReplaceLinks, langParam, paramsLang, originalLanguage, apiKey, translationMode} = options
// shouldReplaceLinks,
// paramsLang,
// apiKey
window.translationScriptTag = window.document.currentScript;
window.translationScriptPrevVersion = PREV_SCRIPT_VERSION // called prev version because it will bumped after published to npm
function initTranslation() {
// replace links with lang (for SEO purposes)
if (translationMode != 'subdomain' && shouldReplaceLinks && paramsLang && (paramsLang != originalLanguage)) {
replaceLinks(window, {langParam, lang: paramsLang, translationMode: options.translationMode});
const options = extractOptionsFromScript(window)
const {shouldReplaceLinks, langParam, paramsLang, originalLanguage, apiKey, translationMode} = options
// shouldReplaceLinks,
// paramsLang,
// apiKey
function initTranslation() {
// replace links with lang (for SEO purposes)
if (translationMode != 'subdomain' && shouldReplaceLinks && paramsLang && (paramsLang != originalLanguage)) {
replaceLinks(window, {langParam, lang: paramsLang, translationMode: options.translationMode});
}
getTranslations(window, apiKey, options)
}
getTranslations(window, apiKey, options)
}
// console.log("window.document.readyState", window.document.readyState)
if (window.document.readyState == 'interactive' || window.document.readyState == 'complete') {
// DOM is already loaded, run the code
initTranslation();
} else {
// DOM is not loaded yet, wait for it
window.document.addEventListener("DOMContentLoaded", function() {
// console.log("window.document.readyState", window.document.readyState)
if (window.document.readyState == 'interactive' || window.document.readyState == 'complete') {
// DOM is already loaded, run the code
initTranslation();
});
} else {
// DOM is not loaded yet, wait for it
window.document.addEventListener("DOMContentLoaded", function() {
initTranslation();
});
}
} catch (error) {
console.error("GLOBALSEO Error: ", error);
}

@@ -36,0 +44,0 @@ }

{
"name": "globalseo",
"version": "2.1.92",
"version": "2.1.93",
"description": "Translate your React.js or Next.js app with AI",

@@ -5,0 +5,0 @@ "main": "index.js",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc