Skip to content

Commit d832320

Browse files
authored
Merge pull request #999 from Ishavyas9/main
api doc update
2 parents 7d37ef2 + 69aaffc commit d832320

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

src/pages/api-doc/index.jsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,33 @@ import React, { useState, useEffect } from 'react';
22
import Layout from '@theme/Layout';
33
import Tabs from '@theme/Tabs';
44
import TabItem from '@theme/TabItem';
5+
import { useLocation } from 'react-router-dom';
56

67
function ApiDoc() {
8+
const location = useLocation();
9+
useEffect(() => {
10+
console.log(location.pathname)
11+
if (location.pathname === '/support/api-doc/') {
12+
const removeAlternateLinks = () => {
13+
const alternateLinks = document.querySelectorAll('link[rel="alternate"]');
14+
alternateLinks.forEach(link => link.parentNode.removeChild(link));
15+
};
16+
17+
removeAlternateLinks();
18+
19+
const observer = new MutationObserver((mutationsList) => {
20+
for (const mutation of mutationsList) {
21+
if (mutation.type === 'childList') {
22+
removeAlternateLinks();
23+
}
24+
}
25+
});
26+
27+
observer.observe(document.body, { childList: true, subtree: true });
28+
29+
return () => observer.disconnect();
30+
}
31+
}, [location.pathname]);
732
return (
833
<Layout title="LambdaTest API Documentation"
934
description="Manage and organize your test builds, test sessions, tunnel status and more with LambdaTest APIs for Selenium automation, App automation, Smart UI automation and Automated screenshots. ">

0 commit comments

Comments
 (0)