Commit 22bfcf13 authored by Remixer Dec's avatar Remixer Dec

fix overriding getElementById on document

parent b2c428a0
...@@ -2,7 +2,7 @@ function gradioApp() { ...@@ -2,7 +2,7 @@ function gradioApp() {
const elems = document.getElementsByTagName('gradio-app') const elems = document.getElementsByTagName('gradio-app')
const elem = elems.length == 0 ? document : elems[0] 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 return elem.shadowRoot ? elem.shadowRoot : elem
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment