diff --git a/src/pages/api-doc/index.jsx b/src/pages/api-doc/index.jsx index 547883e5f..58704f74e 100644 --- a/src/pages/api-doc/index.jsx +++ b/src/pages/api-doc/index.jsx @@ -9,6 +9,22 @@ import TabItem from '@theme/TabItem'; function ApiDoc() { + useEffect(() => { + const removeAlternateLinks = () => { + const alternateLinks = document.querySelectorAll('link[rel="alternate"]'); + alternateLinks.forEach(link => link.parentNode.removeChild(link)); + }; + removeAlternateLinks(); + const observer = new MutationObserver((mutationsList) => { + for (const mutation of mutationsList) { + if (mutation.type === 'childList') { + removeAlternateLinks(); + } + } + }); + observer.observe(document.body, { childList: true, subtree: true }); + return () => observer.disconnect(); + }, []); return (