diff options
author | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-12-08 15:03:07 -0500 |
---|---|---|
committer | toasted-nutbread <toasted-nutbread@users.noreply.github.com> | 2019-12-08 16:01:29 -0500 |
commit | 8ca44d722c6db79f6f3a1892558c7c24f98abd5e (patch) | |
tree | 52f4867445ca09f16ce724e9fb653215c8ed6ab3 /ext/bg | |
parent | 3c749f87053fea88221453f4a6fe4f194726bb6e (diff) |
Prevent scripts from being injected multiple times
Diffstat (limited to 'ext/bg')
-rw-r--r-- | ext/bg/js/search-frontend.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/bg/js/search-frontend.js b/ext/bg/js/search-frontend.js index e21dc371..fdf7219c 100644 --- a/ext/bg/js/search-frontend.js +++ b/ext/bg/js/search-frontend.js @@ -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; |