Use shadowRoot if inside of an iframe and don't use it if outside

This makes sure it will work everywhere
This commit is contained in:
apolinario 2022-12-06 15:13:41 +01:00 committed by GitHub
parent 2eb5f103ab
commit 1075819b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,5 @@
function gradioApp(){
return document
return !!document.getElementsByTagName('gradio-app')[0].shadowRoot ? document.getElementsByTagName('gradio-app')[0].shadowRoot : document
}
function get_uiCurrentTab() {