diff --git a/script.js b/script.js index 978b948f40ab3902f879d7ba09440a048fd8e653..1b9a443f9d75d5cbd474735fcf15544f253f68a0 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 }