From 22bfcf135f8df26f55e01b744bcff748541d44db Mon Sep 17 00:00:00 2001 From: Remixer Dec <6587642+remixer-dec@users.noreply.github.com> Date: Sat, 25 Mar 2023 18:23:34 +0400 Subject: [PATCH] fix overriding getElementById on document --- script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }