aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2022-12-10 13:30:16 +0000
committerGitHub <noreply@github.com>2022-12-10 13:30:16 +0000
commit7cea280a8fd9b7e3cc65a1719d6371d69013c9bb (patch)
tree3f955be85aea43c0c5f6cf1638c7ea07b5372857
parent94a35ca9d6fbea8f710a03247d17c7b6058fb177 (diff)
parent37139d8aac10bd13758f52e3d361f3d017c4ad46 (diff)
downloadstable-diffusion-webui-gfx803-7cea280a8fd9b7e3cc65a1719d6371d69013c9bb.tar.gz
stable-diffusion-webui-gfx803-7cea280a8fd9b7e3cc65a1719d6371d69013c9bb.tar.bz2
stable-diffusion-webui-gfx803-7cea280a8fd9b7e3cc65a1719d6371d69013c9bb.zip
Merge pull request #5447 from apolinario/patch-1
Fix WebUI not working inside of iframes
-rw-r--r--script.js7
1 files changed, 4 insertions, 3 deletions
diff --git a/script.js b/script.js
index 8b3b67e3..9748ec90 100644
--- a/script.js
+++ b/script.js
@@ -1,5 +1,6 @@
-function gradioApp(){
- return document.getElementsByTagName('gradio-app')[0].shadowRoot;
+function gradioApp() {
+ const gradioShadowRoot = document.getElementsByTagName('gradio-app')[0].shadowRoot
+ return !!gradioShadowRoot ? gradioShadowRoot : document;
}
function get_uiCurrentTab() {
@@ -82,4 +83,4 @@ function uiElementIsVisible(el) {
}
}
return isVisible;
-} \ No newline at end of file
+}