Prevent scripts from being injected multiple times

This commit is contained in:
toasted-nutbread 2019-12-08 15:03:07 -05:00
parent 3c749f8705
commit 8ca44d722c

View File

@ -41,6 +41,9 @@ async function searchFrontendSetup() {
'/fg/js/frontend-initialize.js'
];
for (const src of scriptSrcs) {
const node = document.querySelector(`script[src='${src}']`);
if (node !== null) { continue; }
const script = document.createElement('script');
script.async = false;
script.src = src;