diff --git a/src/app/utils/libchat.ts b/src/app/utils/libchat.ts index 28694970..0178385b 100644 --- a/src/app/utils/libchat.ts +++ b/src/app/utils/libchat.ts @@ -8,7 +8,7 @@ export function injectLibchat() { var libchatHash = "1e8f3119e6cff530e0d23e2cb1f2b2a7"; var div = document.createElement("div"); div.id = "libchat_" + libchatHash; - document.getElementsByTagName("body")[0].appendChild(div); + document.body.appendChild(div); var scr = document.createElement("script"); scr.src = "https://libanswers.mit.edu/load_chat.php?hash=" + libchatHash; // we added this error handling to the libanswers-provided script for libchat @@ -16,7 +16,7 @@ export function injectLibchat() { console.error('Libchat script failed to load', scr.src, ev); }; setTimeout(function () { - document.getElementsByTagName("body")[0].appendChild(scr); + document.body.appendChild(scr); }, 2000); } catch (e) { console.error('error injecting libchat', e) diff --git a/src/app/utils/matomo.ts b/src/app/utils/matomo.ts deleted file mode 100644 index 648d22f6..00000000 --- a/src/app/utils/matomo.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* -* This function injects the Matomo Tag Manager