diff options
Diffstat (limited to 'script.js')
-rw-r--r-- | script.js | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,9 +1,10 @@ -function gradioApp(){ - return document.getElementsByTagName('gradio-app')[0].shadowRoot; +function gradioApp() { + const gradioShadowRoot = document.getElementsByTagName('gradio-app')[0].shadowRoot + return !!gradioShadowRoot ? gradioShadowRoot : document; } function get_uiCurrentTab() { - return gradioApp().querySelector('.tabs button:not(.border-transparent)') + return gradioApp().querySelector('#tabs button:not(.border-transparent)') } function get_uiCurrentTabContent() { @@ -82,4 +83,4 @@ function uiElementIsVisible(el) { } } return isVisible; -}
\ No newline at end of file +} |