aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-03-25 17:41:42 +0300
committerGitHub <noreply@github.com>2023-03-25 17:41:42 +0300
commit91ae48fd7e20c60d6374f340cac0939f56d87048 (patch)
tree4ed7414736107794b00f97401607e020cd801b56
parent69eb2a9ee8676640be288bef70ba89956be01478 (diff)
parent22bfcf135f8df26f55e01b744bcff748541d44db (diff)
Merge pull request #8921 from remixer-dec/fix-callstack-loop
fix overriding getElementById on document
-rw-r--r--script.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/script.js b/script.js
index 978b948f..1b9a443f 100644
--- a/script.js
+++ b/script.js
@@ -2,7 +2,7 @@ function gradioApp() {
const elems = document.getElementsByTagName('gradio-app')
const elem = elems.length == 0 ? document : elems[0]
- elem.getElementById = function(id){ return document.getElementById(id) }
+ if (elem !== document) elem.getElementById = function(id){ return document.getElementById(id) }
return elem.shadowRoot ? elem.shadowRoot : elem
}