aboutsummaryrefslogtreecommitdiff
path: root/script.js
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-03-25 16:15:29 +0300
committerGitHub <noreply@github.com>2023-03-25 16:15:29 +0300
commit9b2dcb04bcf3a8ef10bfd9b2aac71e478132ff63 (patch)
tree2f968665d902f887147d2f473612e637e1dc74b2 /script.js
parent252f15e046b06cdcf07caa2ec97a15462950b92a (diff)
parent68953a4705b7f04d82f6cfb4eb2e67756ec666ca (diff)
Merge branch 'master' into master
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..978b948f 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]
+
+ elem.getElementById = function(id){ return document.getElementById(id) }
+ return elem.shadowRoot ? elem.shadowRoot : elem
}
function get_uiCurrentTab() {