has data-stub-lock="inject-lock" try { const headScripts = document.head ? document.head.querySelectorAll("script") : []; for (const s of headScripts) { if ( s.getAttribute && s.getAttribute("data-stub-lock") === "inject-lock" ) { console.warn( 'Inject lock detected (data-stub-lock="inject-lock"). Proceeding with caution ☢️.' ); // return; } } } catch (err) { // If inspection fails, proceed normally (fail-open) console.warn("Inject-lock inspection error:", err); } // --- End safeguard function runModifiers(locale) { const languageInfo = getCurrentLanguageInfo(locale); if (languageInfo.languageCode === "zh" && !hasInjectedChineseExtras) { console.log("Injecting IPC numbers for Chinese..."); injectICP(); console.log("Add bilibili attributes for video button containers..."); addBiliBiliAttributes(); hasInjectedChineseExtras = true; } return rewriteLanguageSelectorUrl(languageInfo); function rewriteLanguageSelectorUrl(languageInfo) { console.log("Rewriting language selector URLs..."); rewriteLanguageOptionLinks(); const languageItemRuns = getLanguageItemRuns(); const updatedLanguageMenus = moveCurrentLanguageToTop( languageItemRuns, languageInfo ); const updatedTriggerLabel = updateLanguageTriggerLabel(languageInfo); if (!updatedLanguageMenus && !updatedTriggerLabel) { console.warn( `No matching language found for html[lang]: ${languageInfo.rawLang}` ); } return updatedLanguageMenus || updatedTriggerLabel; } function rewriteLanguageOptionLinks() { getAllLanguageOptionLinks().forEach((link) => { const languageCode = getLanguageCodeForElement(link); if (!languageCode) { return; } link.href = buildLanguageSelectorUrl(languageCode); }); } function getAllLanguageOptionLinks() { return Array.from(document.querySelectorAll("a[href]")).filter((link) => isKnownLanguageOptionLink(link) ); } function buildLanguageSelectorUrl(languageCode) { const contentPath = getLanguageNeutralPath(window.location.pathname); const localeSlug = getLanguageLocaleSlug(languageCode); const targetOrigin = languageCode === "zh" ? "https://www.f5.com.cn" : "https://www.f5.com"; const targetPath = localeSlug ? `/${localeSlug}${contentPath === "/" ? "" : contentPath}` : contentPath; return `${targetOrigin}${targetPath}${window.location.search}${window.location.hash}`; } function getLanguageNeutralPath(pathname) { const pathSegments = pathname.split("/").filter(Boolean); const localeSlugs = new Set( Object.values(getLanguageLocaleMap()).filter(Boolean) ); const leadingSegment = (pathSegments[0] || "").toLowerCase(); if (localeSlugs.has(leadingSegment)) { const strippedPath = `/${pathSegments.slice(1).join("/")}`; return strippedPath === "/" ? "/" : strippedPath.replace(/\/+$/, ""); } return pathname || "/"; } function getLanguageCodeForElement(element) { const textCandidates = getTextCandidates(element); const languageLabelMap = getLanguageLabelMap(); return ( Object.entries(languageLabelMap).find(([, labels]) => textCandidates.some((value) => labels.some( (label) => value === label.toLowerCase() || value.includes(label.toLowerCase()) ) ) )?.[0] || "" ); } function getLanguageLocaleSlug(languageCode) { return getLanguageLocaleMap()[languageCode] || ""; } function getLanguageLocaleMap() { return { en: "", zh: "", de: "de_de", es: "es_es", fr: "fr_fr", ja: "ja_jp", ko: "ko_kr", pt: "pt_br", }; } function getLanguageItemRuns() { const containerSet = new Set( getAllLanguageOptionLinks() .map((link) => getLanguageItemContainer(link)?.parentElement) .filter(Boolean) ); return Array.from(containerSet).flatMap((container) => { const runs = []; let currentRun = []; Array.from(container.children).forEach((child) => { const languageLink = getLanguageItemLink(child); if (languageLink && isKnownLanguageOptionLink(languageLink)) { currentRun.push({ item: child, link: languageLink }); return; } if (currentRun.length >= 4) { runs.push(currentRun); } currentRun = []; }); if (currentRun.length >= 4) { runs.push(currentRun); } return runs; }); } function moveCurrentLanguageToTop(languageItemRuns, languageInfo) { let didUpdate = false; languageItemRuns.forEach((languageItemRun) => { const currentEntry = languageItemRun.find(({ item }) => isCurrentLanguageItem(item, languageInfo) ); if (!currentEntry) { return; } const firstEntry = languageItemRun[0]; if (firstEntry && currentEntry.item !== firstEntry.item) { firstEntry.item.parentElement.insertBefore( currentEntry.item, firstEntry.item ); } languageItemRun.forEach(({ link }) => { link.classList.remove("currentURL"); }); currentEntry.link.classList.add("currentURL"); didUpdate = true; }); return didUpdate; } function updateLanguageTriggerLabel(languageInfo) { const preferredLabel = getPreferredLanguageLabel(languageInfo.languageCode); if (!preferredLabel) { return false; } let didUpdate = false; Array.from( document.querySelectorAll( "[data-slot='menubar-trigger'], button[aria-haspopup='menu']" ) ).forEach((trigger) => { const textElement = getTriggerTextElement(trigger); if (!textElement) { return; } const triggerText = normalizeText(textElement.textContent); if (!getAllLanguageLabels().has(triggerText)) { return; } textElement.textContent = preferredLabel; didUpdate = true; }); return didUpdate; } function getLanguageItemContainer(link) { return link.closest("li, [role='menuitem']") || link.parentElement; } function getLanguageItemLink(listItem) { if (!listItem) { return null; } if (listItem.matches?.("a[href]")) { return listItem; } return listItem.querySelector("a[href]") || listItem.querySelector("a"); } function getTriggerTextElement(trigger) { return ( Array.from(trigger.querySelectorAll("p, span")).find((element) => normalizeText(element.textContent) ) || null ); } function getAllLanguageLabels() { return new Set( Object.values(getLanguageLabelMap()) .flat() .map((label) => label.toLowerCase()) ); } function isKnownLanguageOptionLink(link) { return getAllLanguageLabels().has(normalizeText(link.textContent)); } function getPreferredLanguageLabel(languageCode) { const labelCandidates = getLanguageLabelCandidates(languageCode); return labelCandidates[0] || ""; } function normalizeText(value) { return (value || "").trim().toLowerCase(); } function isCurrentLanguageItem(element, languageInfo) { if (!element) { return false; } const labelCandidates = getLanguageLabelCandidates( languageInfo.languageCode ); const textCandidates = getTextCandidates(element); if ( textCandidates.some((value) => labelCandidates.some( (label) => value === label || value.includes(label) ) ) ) { return true; } const localeCandidates = getLocaleCandidates(languageInfo); const attributeCandidates = getAttributeCandidates(element); if ( attributeCandidates.some( (value) => localeCandidates.has(value) || value === languageInfo.languageCode || value.startsWith(`${languageInfo.languageCode}-`) ) ) { return true; } try { return getHrefCandidates(element).some((hrefValue) => { const pathName = new URL(hrefValue, window.location.origin).pathname .toLowerCase() .replace(/\/+$/, ""); const pathSegments = pathName.split("/").filter(Boolean); const leadingSegment = (pathSegments[0] || "").replace(/_/g, "-"); if (localeCandidates.has(leadingSegment)) { return true; } if (languageInfo.languageCode === "en") { return leadingSegment === ""; } return ( leadingSegment === languageInfo.languageCode || leadingSegment.startsWith(`${languageInfo.languageCode}-`) ); }); } catch (err) { console.warn("Unable to inspect language selector link:", err); } return false; } function getTextCandidates(element) { const nodes = [element].concat(Array.from(element.querySelectorAll("*"))); return nodes .map((node) => (node.textContent || "").trim().toLowerCase()) .filter(Boolean); } function getAttributeCandidates(element) { const nodes = [element].concat(Array.from(element.querySelectorAll("*"))); return nodes .flatMap((node) => [ node.getAttribute?.("lang"), node.getAttribute?.("hreflang"), node.getAttribute?.("data-lang"), node.getAttribute?.("data-locale"), ]) .filter(Boolean) .map((value) => value.toLowerCase().replace(/_/g, "-")); } function getHrefCandidates(element) { const nodes = [element].concat(Array.from(element.querySelectorAll("a"))); return nodes .map((node) => node.getAttribute?.("href") || node.href) .filter(Boolean); } function getLocaleCandidates(languageInfo) { const candidates = new Set(); [ languageInfo.rawLang, languageInfo.normalizedLang, languageInfo.underscoredLang, languageInfo.languageCode, languageInfo.regionCode, ] .filter(Boolean) .forEach((value) => { candidates.add(value.toLowerCase()); candidates.add(value.toLowerCase().replace(/_/g, "-")); }); return candidates; } function getLanguageLabelCandidates(languageCode) { const languageLabels = getLanguageLabelMap(); return (languageLabels[languageCode] || []).map((label) => label.toLowerCase() ); } function getLanguageLabelMap() { return { en: ["English"], zh: ["中文", "Chinese", "简体中文", "繁體中文"], de: ["Deutsch", "German"], es: ["Español", "Spanish"], fr: ["Français", "French"], ja: ["日本語", "Japanese"], ko: ["한국어", "Korean"], pt: ["Português", "Portuguese"], }; } function rewriteBrandLink() { console.log("Rewriting brand link to prevent double mapping..."); let brandLinks = Array.from(document.querySelectorAll(".brand-link")); brandLinks.forEach((elem) => { elem.href = elem.href.substring(0, elem.href.lastIndexOf("/")); }); } function injectICP() { if ( document.querySelector('a[href="proxy.php?url=https%3A%2F%2Fbeian.miit.gov.cn%2F%23%2FIntegrated%2Findex"]') ) { return; } let legals = document.querySelector("div#f5-footer-legal-links"); if (!legals) { return; } let icpContainer = document.createElement("li"); icpContainer.setAttribute("translate", "no"); console.log("Constructing ICP license tag..."); let icpLicense = document.createElement("a"); icpLicense.textContent = "京ICP备16013763号"; icpLicense.href="proxy.php?url=https%3A%2F%2Fbeian.miit.gov.cn%2F%23%2FIntegrated%2Findex"; icpLicense.setAttribute("target", "_blank"); icpLicense.setAttribute("rel", "noreferrer"); icpContainer.classList.add( "u02a-legal__list-item", "U:nudge-bot-sm", "U:nudge-rt-lg" ); icpContainer.appendChild(icpLicense); console.log("Constructing registrar tag..."); let registrarTag = document.createElement("a"); registrarTag.textContent = "京公网安备 11010502048271号"; registrarTag.href="proxy.php?url=http%3A%2F%2Fwww.beian.gov.cn%2Fportal%2FregisterSystemInfo%3Frecordcode%3D11010502048271"; registrarTag.setAttribute("target", "_blank"); registrarTag.setAttribute("rel", "noreferrer"); let registrarContainer = document.createElement("li"); registrarContainer.setAttribute("translate", "no"); registrarContainer.classList.add( "u02a-legal__list-item", "U:nudge-bot-sm", "U:nudge-rt-lg" ); registrarContainer.appendChild(registrarTag); console.log("Injecting tags..."); legals.appendChild(icpContainer); legals.appendChild(registrarContainer); } function addBiliBiliAttributes() { var bilibiliBtns = Array.from( document.querySelectorAll('a[target="f5modal-video"]') ).filter((it) => it.getAttribute("href").includes("bilibili")); bilibiliBtns.forEach((it) => it.parentElement.setAttribute("data-type", "bilibili") ); } } function getCurrentLanguageInfo(locale) { const rawLang = ( locale || document.documentElement.getAttribute("lang") || "en" ) .trim() .toLowerCase(); const normalizedLang = rawLang.replace(/_/g, "-"); const [languageCode = "en", regionCode = ""] = normalizedLang .split("-") .filter(Boolean); return { rawLang, normalizedLang, underscoredLang: normalizedLang.replace(/-/g, "_"), languageCode, regionCode, }; } function rerunModifiers() { runModifiers(document.documentElement.getAttribute("lang")); } function scheduleModifierRefresh() { [0, 100, 250, 500, 1000, 1500].forEach((delay) => { window.setTimeout(() => { rerunModifiers(); }, delay); }); } function attachMenuRefreshListener() { if (hasMenuRefreshListener) { return; } document.addEventListener( "click", (event) => { const trigger = event.target.closest?.( "[data-slot='menubar-trigger'], button[aria-haspopup='menu']" ); if (!trigger) { return; } scheduleModifierRefresh(); }, true ); const refreshLanguageLink = (event) => { const languageLink = event.target.closest?.("a[href]"); if (!languageLink) { return; } const linkText = (languageLink.textContent || "").trim().toLowerCase(); if (!getAllLanguageLabels().has(linkText)) { return; } scheduleModifierRefresh(); }; document.addEventListener("mouseover", refreshLanguageLink, true); document.addEventListener("focusin", refreshLanguageLink, true); hasMenuRefreshListener = true; } window.addEventListener("load", function () { "use strict"; crestTranslatorAvailable().then((_) => { attachMenuRefreshListener(); window.addEventListener( "crestDocumentTranslationEnd", () => { rerunModifiers(); } ); }); }); })();
SecureIQLab validated F5 BIG-IP with Dell ObjectScale: continuous S3 traffic during simulated DDoS attacks and node failures—with no material throughput penalty.
Explore how multi-model AI and distributed inferencing are evolving to impact app delivery and security—and what it could mean for you.
Get the reportAttend June 23-25 to watch F5 and industry leaders outline an AI architecture for the age of inference, with a featured keynote by Gartner® VP Analyst.
See why you should attend
Plus, get platform-trained intelligence and iRules code generation to simplify complex delivery and security workflows.
Access the F5 Application Delivery and Security Platform (ADSP) through any of our buying programs, including term subscriptions, the Flex Consumption Program (FCP), and perpetual licensing. Contact F5 Sales to learn more.

See why the 2026 GigaOm Radar recognized F5 for simplifying data transmission with software-driven orchestration, addressing challenges like network design, segmentation, and security.
Get the reportSource: Fortune.com
Our customers' success is our badge of honor. Here are a few of the latest success stories.
Explore all case studies ›