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.2.10 to 2.2.11

40

extractOptionsFromScript.js

@@ -6,2 +6,23 @@ const { isBrowser, BRAND } = require("./utils/configs");

function replaceCustomLinks(window, customLinks = {}) {
// find all tags with href and src
const tagsWithSrc = window.document.querySelectorAll("[src]");
const tagsWithHref = window.document.querySelectorAll("[href]");
// replace the links
for (let tag of tagsWithSrc) {
const src = tag.getAttribute("src");
if (customLinks[src]) {
tag.setAttribute("src", customLinks[src]);
}
}
for (let tag of tagsWithHref) {
const href = tag.getAttribute("href");
if (customLinks[href]) {
tag.setAttribute("href", customLinks[href]);
}
}
}
/**

@@ -56,2 +77,3 @@ * Extracts options from a script.

const DATA_DOMAIN_SOURCE_PREFIX = "data-domain-source-prefix"
const DATA_CUSTOM_LINKS = "data-custom-links"

@@ -64,2 +86,17 @@ const DATA_TRANSLATION_CACHE = "data-translation-cache";

const customLinksAttribute = window.translationScriptTag.getAttribute(DATA_CUSTOM_LINKS);
let customLinks = {};
try {
// format: [oldUrl,newUrl], [oldUrl,newUrl]
const parsed = JSON.parse(`[${customLinksAttribute}]`);
customLinks = parsed.reduce((acc, [oldUrl, newUrl]) => {
acc[oldUrl] = newUrl;
return acc;
}, {});
replaceCustomLinks(window, customLinks);
} catch (e) {
customLinks = {};
}
const DATA_ACTIVE_SUBDOMAIN = "data-active-subdomain"; // default: undefined

@@ -370,3 +407,4 @@ const activeSubdomain = window.translationScriptTag.getAttribute(DATA_ACTIVE_SUBDOMAIN);

translationMode,
domainSourcePrefix
domainSourcePrefix,
customLinks,
}

@@ -373,0 +411,0 @@ }

2

package.json
{
"name": "globalseo",
"version": "2.2.10",
"version": "2.2.11",
"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