Included fetching tite

This commit is contained in:
Brychan Dempsey 2021-06-08 22:10:38 +12:00
parent 6aab0ee986
commit e00558937a

View File

@ -7,6 +7,9 @@
background-color: #383c4a;
}
</style>
<link rel="stylesheet" href="/css/index.css">
<link rel="stylesheet" href="/css/theme-night-sky.css">
<script>
const queryString = window.location.search;
const queryLoc = window.location.origin;
@ -29,11 +32,13 @@
var htmlTrimmed = doc.querySelector(selector);
if (htmlTrimmed) {
htmlTrimmed = htmlTrimmed.parentElement;
/*
var styleSheets = doc.querySelectorAll("link");
for (var i = 0; i < styleSheets.length; i++) {
document.head.appendChild(styleSheets[i]);
}
} */
// Fetch and refactor links, to use this html doc where appropriate
document.title = doc.title;
var hlinks = htmlTrimmed.querySelectorAll("a");
for (var i = 0; i < hlinks.length; i++) {
if (hlinks[i].href.replace(queryLoc, "").startsWith("/")) {