From 1075819b16ef328805dd946acaffd43efa2eb444 Mon Sep 17 00:00:00 2001 From: apolinario Date: Tue, 6 Dec 2022 15:13:41 +0100 Subject: [PATCH] Use shadowRoot if inside of an iframe and don't use it if outside This makes sure it will work everywhere --- script.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script.js b/script.js index d9424de9..49b6c557 100644 --- a/script.js +++ b/script.js @@ -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() {