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> <head>
<base target="_blank" />
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta <meta
name="viewport" name="viewport"

View File

@ -178,6 +178,14 @@
async function handle_mount() { async function handle_mount() {
await tick(); 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( dependencies.forEach(
( (
{ targets, trigger, inputs, outputs, queue, backend_fn, frontend_fn }, { targets, trigger, inputs, outputs, queue, backend_fn, frontend_fn },

View File

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