Skip to content

Commit 334a103

Browse files
authored
[web] add index to webpages (#10640)
1 parent 00fce38 commit 334a103

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

common/src/web/index.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Index of Available Pages</title>
6+
</head>
7+
<body>
8+
<script>
9+
(async () => {
10+
const response = await fetch('https://api.github.com/repos/SeleniumHQ/selenium/git/trees/gh-pages?recursive=true');
11+
const data = await response.json();
12+
const list = data.tree
13+
let htmlString = '<ul>';
14+
15+
for (let item of list) {
16+
const name = item.path;
17+
if (name.substring(0, 1) !== 'w') { continue; }
18+
if (name.substring(name.length-4, name.length) !== 'html') { continue; }
19+
const val = name.substring(4, name.length);
20+
htmlString += `<li><a href="${val}">${val}</a></li>`;
21+
}
22+
23+
htmlString += '</ul>';
24+
document.getElementsByTagName('body')[0].innerHTML = htmlString;
25+
})()
26+
</script>
27+
</body>
28+
</html>

0 commit comments

Comments
 (0)