Prevent scripts from being injected multiple times
This commit is contained in:
parent
3c749f8705
commit
8ca44d722c
@ -41,6 +41,9 @@ async function searchFrontendSetup() {
|
|||||||
'/fg/js/frontend-initialize.js'
|
'/fg/js/frontend-initialize.js'
|
||||||
];
|
];
|
||||||
for (const src of scriptSrcs) {
|
for (const src of scriptSrcs) {
|
||||||
|
const node = document.querySelector(`script[src='${src}']`);
|
||||||
|
if (node !== null) { continue; }
|
||||||
|
|
||||||
const script = document.createElement('script');
|
const script = document.createElement('script');
|
||||||
script.async = false;
|
script.async = false;
|
||||||
script.src = src;
|
script.src = src;
|
||||||
|
Loading…
Reference in New Issue
Block a user