aboutsummaryrefslogtreecommitdiffstats
path: root/script.js
diff options
context:
space:
mode:
authorspace-nuko <24979496+space-nuko@users.noreply.github.com>2023-03-27 21:26:23 +0000
committerGitHub <noreply@github.com>2023-03-27 21:26:23 +0000
commit082613036aa7b9a8a008384b1770046d6714bc28 (patch)
treea14ceb8cc54e7359058376ff6eb05bc3471f5e67 /script.js
parentd86beb822832c9162714cf0a3567ad087839a2ac (diff)
parent955df7751eef11bb7697e2d77f6b8a6226b21e13 (diff)
downloadstable-diffusion-webui-gfx803-082613036aa7b9a8a008384b1770046d6714bc28.tar.gz
stable-diffusion-webui-gfx803-082613036aa7b9a8a008384b1770046d6714bc28.tar.bz2
stable-diffusion-webui-gfx803-082613036aa7b9a8a008384b1770046d6714bc28.zip
Merge branch 'master' into remove-watermark-option
Diffstat (limited to 'script.js')
-rw-r--r--script.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/script.js b/script.js
index 97e0bfcf..1b9a443f 100644
--- a/script.js
+++ b/script.js
@@ -1,7 +1,9 @@
function gradioApp() {
const elems = document.getElementsByTagName('gradio-app')
- const gradioShadowRoot = elems.length == 0 ? null : elems[0].shadowRoot
- return !!gradioShadowRoot ? gradioShadowRoot : document;
+ const elem = elems.length == 0 ? document : elems[0]
+
+ if (elem !== document) elem.getElementById = function(id){ return document.getElementById(id) }
+ return elem.shadowRoot ? elem.shadowRoot : elem
}
function get_uiCurrentTab() {