maybe fix auth in iframes (#1261)

* maybe fix auth in iframes

* remove comment

* Update gradio/templates/frontend/index.html

* fix gitignore?

Co-authored-by: aliabid94 <aabid94@gmail.com>
Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
pngwn 2022-05-16 11:07:11 +01:00 committed by GitHub
parent 569a16998d
commit b69e8cb151
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 1 deletions

View File

@ -11,7 +11,6 @@
"
>
<head>
<base target="_blank" />
<meta charset="utf-8" />
<meta
name="viewport"

View File

@ -178,6 +178,14 @@
async function handle_mount() {
await tick();
var a = document.getElementsByTagName("a");
for (var i = 0; i < a.length; i++) {
const target = a[i].getAttribute("target");
if (target !== "_blank") a[i].setAttribute("target", "_blank");
}
dependencies.forEach(
(
{ targets, trigger, inputs, outputs, queue, backend_fn, frontend_fn },

View File

@ -86,6 +86,7 @@ window.launchGradio = (config: Config, element_query: string) => {
target: target,
props: config
});
window.__gradio_loader__.$set({ status: "complete" });
} else {
handle_darkmode(target);